{"record":{"id":"20dd57e3fbdcafbd","repo":"hibernate/hibernate-orm","slug":"support-for-foreign-keys-based-on-s-not-yet-imp","errorCode":null,"errorMessage":"Support for foreign-keys based on `%s` not yet implemented: %s -> %s","messagePattern":"Support for foreign-keys based on `(.+?)` 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":923,"sourceCode":"\t\t\t}\n\t\t\telse if ( modelPart instanceof EmbeddableValuedModelPart embeddableValuedModelPart ) {\n\t\t\t\tfinal var embeddedForeignKeyDescriptor = buildEmbeddableForeignKeyDescriptor(\n\t\t\t\t\t\tgetPropertyPath( attributeMapping.getNavigableRole() ),\n\t\t\t\t\t\tembeddableValuedModelPart,\n\t\t\t\t\t\tbootValueMapping,\n\t\t\t\t\t\tattributeMapping.getDeclaringType(),\n\t\t\t\t\t\tattributeMapping.findContainingEntityMapping(),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tbootValueMapping.getColumnInsertability(),\n\t\t\t\t\t\tbootValueMapping.getColumnUpdateability(),\n\t\t\t\t\t\tcreationProcess\n\t\t\t\t);\n\t\t\t\tattributeMapping.setForeignKeyDescriptor( embeddedForeignKeyDescriptor );\n\t\t\t\tattributeMapping.setupCircularFetchModelPart( creationProcess );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\t\"Support for foreign-keys based on `\" + modelPart + \"` not yet implemented: \" +\n\t\t\t\t\t\t\t\tbootProperty.getPersistentClass().getEntityName() + \" -> \" + bootProperty.getName()\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tfinal var fkTarget =\n\t\t\t\tbootValueMapping.isReferenceToPrimaryKey()\n\t\t\t\t\t\t? referencedEntityDescriptor.getIdentifierMappingForJoin()\n\t\t\t\t\t\t: referencedEntityDescriptor.findByPath( bootValueMapping.getReferencedPropertyName() );\n\n\t\tfinal var simpleFkTarget = fkTarget.asBasicValuedModelPart();\n\t\tif ( simpleFkTarget != null ) {\n\t\t\tfinal var columnIterator = bootValueMapping.getSelectables().iterator();\n\t\t\tfinal var table = bootValueMapping.getTable();\n\t\t\tfinal String tableExpression = getTableIdentifierExpression( table, creationProcess );\n\t\t\tfinal PropertyAccess declaringKeyPropertyAccess = getDeclaringKeyPropertyAccess(","sourceCodeStart":905,"sourceCodeEnd":941,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java#L905-L941","documentation":"Error \"Support for foreign-keys based on `%s` not yet implemented: %s -> %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a foreign key refers to a key mapping kind (e.g. a non-identifier referenced key) that is not yet implemented for that mapping.","commonSituations":"See trigger scenarios.","solutions":["Base the foreign key on supported model parts (basic attributes, to-one associations); restructure the referenced mapping."],"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"}