The generated User_.class does not contain the ADDRESS field. And the Address_.class is not generated as well.
When I annotate the Address class with @Embeddable, the generation work but Hibernate throws a name conflict exception when running the app.
This is the exception message after annotating the Address class with @Embeddable:
HHH000099: an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: conflicting type names
I’m using Spring boot 3.3.4 with Hibernate 6.5.3.Final
The Hibernate Processor only generates the static metamodel for mapped classes, that is mapped superclasses, entities and embeddables, so you will need to mark Address as @Embeddable (note this is also required by the JPA specification, but Hibernate still tries to make things work if you don’t but this is one of the side effects).
As for the assertion error you’re encountering, I don’t see anything specifically wrong with the mappings you pasted here, though there are other components at play which might be interfering with the mappings (you mentioned Spring, and I suppose Lombok from the annotation).
The only thing I can suggest is trying to see if you can reproduce the problem using Hibernate only, you can start from our test case templates, and if you don’t there probably is something else messing with your mappings and causing the error.
I tried upgrading the Hibernate version in my spring boot app to 6.6.2.Final. Now everything worked as expected.
For the moment, I reverted the changes because Spring Boot 3.4.0 (which includes Spring Data JPA 3.4.0 and Hibernate 6.6.2.Final) will be released tomorrow. I’ll just wait and upgrade my project to solve it.