hibernate/hibernate-orm · error · UnsupportedOperationException
Support for %s foreign keys not yet implemented: %s
Error message
Support for %s foreign keys not yet implemented: %s
What it means
Error "Support for %s foreign keys not yet implemented: %s" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java:817
else if ( fkTargetPart instanceof EmbeddableValuedModelPart embeddableValuedModelPart ) {
final var keyDescriptor = buildEmbeddableForeignKeyDescriptor(
getPropertyPath( attributeMapping.getNavigableRole() ),
embeddableValuedModelPart,
bootValueMapping,
keyDeclaringType,
collectionDescriptor.getAttributeMapping(),
collectionTableName,
false,
bootValueMappingKey.getColumnInsertability(),
bootValueMappingKey.getColumnUpdateability(),
creationProcess
);
attributeMapping.setForeignKeyDescriptor( keyDescriptor );
// creationProcess.registerForeignKey( collectionDescriptor.getAttributeMapping(), keyDescriptor );
}
else {
throw new UnsupportedOperationException(
"Support for " + fkTargetPart.getClass() + " foreign keys not yet implemented: " + bootValueMapping.getRole()
);
}
}
static String getCollectionPropertyPath(CollectionPersister collectionPersister) {
return collectionPersister.getNavigableRole().getFullPath()
.substring( collectionPersister.getOwnerEntityPersister().getNavigableRole().getFullPath().length() + 1 );
}
static String getPropertyPath(NavigableRole navigableRole) {
final StringBuilder propertyPath = new StringBuilder();
while (navigableRole.getParent() != null) {
if ( !propertyPath.isEmpty() ) {
propertyPath.insert( 0, "." );
}
propertyPath.insert( 0, navigableRole.getLocalName() );
navigableRole = navigableRole.getParent();View on GitHub (pinned to fad1729dce)
Solutions
- Restructure the mapping to avoid the unsupported foreign key kind (e.g. use basic or to-one key parts only), or upgrade Hibernate if support was added.
When it happens
Trigger: Thrown when a collection foreign key is based on a mapping kind (e.g. formula or non-column key) that is not yet implemented.
Common situations: See trigger scenarios.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/1eac81cd75e21fd6.
Report an issue: GitHub.