{"record":{"id":"1eac81cd75e21fd6","repo":"hibernate/hibernate-orm","slug":"support-for-s-foreign-keys-not-yet-implemented","errorCode":null,"errorMessage":"Support for %s foreign keys not yet implemented: %s","messagePattern":"Support for (.+?) foreign keys not yet implemented: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java","lineNumber":817,"sourceCode":"\t\telse if ( fkTargetPart instanceof EmbeddableValuedModelPart embeddableValuedModelPart ) {\n\t\t\tfinal var keyDescriptor = buildEmbeddableForeignKeyDescriptor(\n\t\t\t\t\tgetPropertyPath( attributeMapping.getNavigableRole() ),\n\t\t\t\t\tembeddableValuedModelPart,\n\t\t\t\t\tbootValueMapping,\n\t\t\t\t\tkeyDeclaringType,\n\t\t\t\t\tcollectionDescriptor.getAttributeMapping(),\n\t\t\t\t\tcollectionTableName,\n\t\t\t\t\tfalse,\n\t\t\t\t\tbootValueMappingKey.getColumnInsertability(),\n\t\t\t\t\tbootValueMappingKey.getColumnUpdateability(),\n\t\t\t\t\tcreationProcess\n\t\t\t);\n\n\t\t\tattributeMapping.setForeignKeyDescriptor( keyDescriptor );\n//\t\t\tcreationProcess.registerForeignKey( collectionDescriptor.getAttributeMapping(), keyDescriptor );\n\t\t}\n\t\telse {\n\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\"Support for \" + fkTargetPart.getClass() + \" foreign keys not yet implemented: \" + bootValueMapping.getRole()\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic String getCollectionPropertyPath(CollectionPersister collectionPersister) {\n\t\treturn collectionPersister.getNavigableRole().getFullPath()\n\t\t\t\t.substring( collectionPersister.getOwnerEntityPersister().getNavigableRole().getFullPath().length() + 1 );\n\t}\n\n\tstatic String getPropertyPath(NavigableRole navigableRole) {\n\t\tfinal StringBuilder propertyPath = new StringBuilder();\n\t\twhile (navigableRole.getParent() != null) {\n\t\t\tif ( !propertyPath.isEmpty() ) {\n\t\t\t\tpropertyPath.insert( 0, \".\" );\n\t\t\t}\n\t\t\tpropertyPath.insert( 0, navigableRole.getLocalName() );\n\t\t\tnavigableRole = navigableRole.getParent();","sourceCodeStart":799,"sourceCodeEnd":835,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java#L799-L835","documentation":"Error \"Support for %s foreign keys not yet implemented: %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a collection foreign key is based on a mapping kind (e.g. formula or non-column key) that is not yet implemented.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}