SpringBoot hibernate gradle byte code improvement

I am trying to use hibernate. OneToOne connections work lazily.

My setup is spring -data-jpa using hibernation and Gradle.

Even this is a well-documented issue / feature, and there are a lot of good readings, I realized that most of them deal with maven.

Fortunately, there is a Gradle plugin that can be used for this specific reason, and although the documentation is not the best, I found this post that also addresses the same problem, and this seems like a pretty simple solution.

After I implemented the changes needed in my Gradle script, it seemed that hibernate was still loading the OneToOne relationship impatiently, so I tried to execute

./gradlew build

and noticed that the following message was printed:

Hibernate Bytecode Extension Skip Because Feature Not Enabled

according to the source code of the plugin , this message is displayed when the extension is not included, which is not the way I use:

hibernate {
enhance {
    enableLazyInitialization= true
    enableDirtyTracking = true
    enableAssociationManagement = true
    enableExtendedEnhancement = true
}}

So my question is: did anyone get this to work correctly? If yes, can you point me to some tutorial / guide to achieve this? I use an interceptor in an integration test to check the number of requests that sleep mode uses, as well as monitoring sql logs.

+4
source share

Source: https://habr.com/ru/post/1694243/


All Articles