Perhaps to say it a different way.
Ebean enhancement works on classes so it doesn't care how those classes are compiled (java, kotlin, scala etc).
The java agent enhancement performs enhancement when classes are loaded/defined.
Those entity classes should have getter/setter type methods (not field access, it was play that magically turned field access into getter/setter calls. There isn't a strict need for getter/setter methods though, any get/mutate methods are fine)
Ebean enhancement adds it's own interceptor methods and swaps out GETFIELD / PUTFIELD calls to instead use it's interceptor methods (for dirty checking/lazy loading etc).
Why we desire to use build time enhancement (via maven plugin or gradle plugin) is so that:
- We no longer need to specify the java agent on the command line when running the built application
- We don't pay any extra runtime cost for enhancement (as we pay that cost at build time).
So say we have an app using sbt. That has entity beans and @Transactional methods etc ... as long as we have the javaagent command line argument specifying the ebean agent ... then all the ebean enhancement will occur (when the classes are loaded/defined). So if we have the intellij idea plugin installed and on it will add that javaagent to the command line then all enhancement would occur as expected.
Note: we can get the ebean-agent to output debug via having a:
src/main/resources/ebean.mf
with content of: (well, any value from 1 to 9 ... 9 being very verbose output)
debug: 3
Note that manifest files should have a trailing empty line (I think that isn't obvious when using eclipse ide).
So if using IntelliJ and we are using the ebean plugin etc then probably it is a case of adding the ebean.mf file with a debug line and checking the output (to confirm what the ebean-agent is doing wrt enhancement). The downside here is that in an ideal world we use build time enhancement to make our production service that little bit faster (as enhancement is already done, doesn't need to occur at runtime).
Cheers, Rob.