Caused by: org.hibernate.MappingException: param named "property" is required for foreign id generation strategy at org.hibernate.id.ForeignGenerator.configure(ForeignGenerator.java:84) at org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory.createIdentifierGenerator(StandardIdentifierGeneratorFactory.java:231) ... 22 more
My expectation is that generator generates mapping that loads without exceptions. I speculate that:
Hi @pekuz,
This bug is present in the 6.x and older releases. It has been fixed when the tooling codebase was merged into ORM. Can you please try if the problem persists in version 7.4.5.Final or 8.x?
Cheers, Koen
package dbo;
// Generated Jul 14, 2026, 10:58:20 AM by Hibernate Tools 7.3.12.Final
but to the same erroneous outcome at 6.x runtime:
Caused by: org.hibernate.MappingException: param named "property" is required for foreign id generation strategy at org.hibernate.id.ForeignGenerator.configure(ForeignGenerator.java:84)
thx, I got it now, the groupId and artifactId has to be changed too. I’m getting now:
package dbo;
// Generated Jul 14, 2026, 11:36:36 AM by Hibernate Tools 7.4.5.Final
but it still generates @GenericGenerator and @GeneratedValue annotations on the PK=FK column property, resulting in the same 6.x runtime mapping exception.
Hi,
Thanks for verifying with 7.4.5. This is indeed a bug in the hibernate-orm tooling. The existing test for this scenario (OneToOne/TestCase.java#testGenerateAnnotatedClassesAndReadable) apparently only validates the schema against the database and never builds a SessionFactory, so ForeignGenerator.configure() is never called and the missing property parameter goes undetected.
Could you file a bug against https://hibernate.atlassian.net/browse/HHH for it? Ideally include your create.sql and reveng.xml so it’s easy to reproduce.
As a broader point, ForeignGenerator has been @Deprecated(since = "6", forRemoval = true). Rather than just adding the missing property parameter, the tooling should probably stop generating @GenericGenerator(strategy="foreign") altogether for PK=FK columns and use @MapsId instead as that’s the modern JPA way to express this pattern.