hibernate-orm
hibernate-orm copied to clipboard
HHH-18228: Fix hibernate-tool code generation (ClassNotFoundException)
Foreign keys based on compound keys run into a check for java records. But the to-be-generated classes do not exist on the classpath and therefore the check fails.
Issue: https://hibernate.atlassian.net/browse/HHH-18228
Any feedback on this?
Thanks for your pull request!
This pull request appears to follow the contribution rules.
› This message was automatically generated.
Hibernate doesn't seem to be dead... So the project is simply not interested in community contributions?! Would be too sad, if no solution will be implemented for that problem...
Reproducer: https://github.com/fanste/reproducers/tree/hhh-18228
Run it using the command mvn generate-sources.
This should throw the following error:
[ERROR] Failed to execute goal org.hibernate.tool:hibernate-tools-maven:6.6.2.Final:hbm2java (entity-generation) on project hhh-18228: Execution entity-generation of goal org.hibernate.tool:hibernate-tools-maven:6.6.2.Final:hbm2java failed: component class not found: Tbltest1Id
Reason is the compound primary key of tblTest1 also used as a foreign key in tblTest2. The demonstrated use case is simplied to the bare minimum.
Fixed by HBX-2840 / hibernate-tools#4986