Hi,
I upgraded hibernate to version 6.5 in my project and it’s reporting warning about the association mappings when generating the metamodel which seems wrong in my case.
I suppose it’s related to the new feature : [HHH-17875] - Hibernate JIRA.
Here is a reproducer : GitHub - ArnaudLec/hibernate-processor-bug
It’s reporting the following problems in the code when building the project with mvn clean compile
:
[WARNING] diagnostic: src\main\java\com\example\entity\Organization.java:19: warning: member 'organization' of 'Assignment' is not annotated '@ManyToOne'
@OneToMany(mappedBy = "organization", fetch = FetchType.LAZY, orphanRemoval = true)
^
[WARNING] diagnostic: src\main\java\com\example\entity\Person.java:19: warning: member 'person' of 'Assignment' is not annotated '@ManyToOne'
@OneToMany(mappedBy = "person", fetch = FetchType.LAZY, orphanRemoval = true)
^
The generated metamodel is fine and works correctly, only the warnings seems wrong in this case.
If the problem is in my code, I don’t see what’s wrong with it.