Closed jamestrandung closed 4 years ago
Is this only an IDE issue? The classes should have been generated in your target directory, is that the case? If yes, you have to mark the directory of the generated classes (target/annotations if I remember well) as « generated sources ». If not, are the hibernate metadata generated? If not, annotation processors are being ignored by your maven config or ide settings for a reason you will have to dig about.
The classes are generated in target/generated-sources/annotations
@reda-alaoui Hi. Thanks for your comments. I actually have no idea how this generator is supposed to work. I just noticed its existence recently after using the main library for quite some time.
My assumption was that it should work like Lombok, meaning after I add in the spring-data-jpa-entity-graph-generator
library, I should be able to access the generated class just like how I access Lombok builder via @Builder annotation. I do see the generated class from Lombok in the target directory. However, I'm not seeing anything with EntityGraph suffix.
If yes, you have to mark the directory of the generated classes (target/annotations if I remember well) as « generated sources ».
If not, are the hibernate metadata generated? If not, annotation processors are being ignored by your maven config or ide settings for a reason you will have to dig about.
If my assumption is wrong and the generator library requires some specific settings to work, can you explain more on what I need to do? I don't have anything special in my pom.xml
that instructs Hibernate to ignore specific package/folder.
@reda-alaoui My generated-sources folder is empty.
That means annotation processing is ignored for some reason.
spring-data-jpa-entity-graph-generator
and hibernate-jpamodelgen
are Annotation Processor
s. When in the compilation classpath, they should automatically be detected by javac (Java compiler). This is the case for our company builds.
I don't know if Lombok is a basic annotation processor but there is plenty of web resources explaining how to fix Annotation Processor
malfunction.
You can also read that => https://docs.jboss.org/hibernate/orm/5.0/topical/html/metamodelgen/MetamodelGenerator.html
I created https://github.com/Cosium/spring-data-jpa-entity-graph-sample which is a demo application for this extension. The demo uses the generator and the generated entity graphs.
Following documentation, I added the following dependencies.
In my class, when I try to access the generated EntityGraph after compiling the project, the IDE cannot find such class. Is there something else I need to do?
Versions: