hibernate/hibernate-orm · error · UnsupportedOperationException

Support for foreign-keys based on `%s` not yet implemented:

Error message

Support for foreign-keys based on `%s` not yet implemented: %s -> %s

What it means

Error "Support for foreign-keys based on `%s` not yet implemented: %s -> %s" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java:923

			}
			else if ( modelPart instanceof EmbeddableValuedModelPart embeddableValuedModelPart ) {
				final var embeddedForeignKeyDescriptor = buildEmbeddableForeignKeyDescriptor(
						getPropertyPath( attributeMapping.getNavigableRole() ),
						embeddableValuedModelPart,
						bootValueMapping,
						attributeMapping.getDeclaringType(),
						attributeMapping.findContainingEntityMapping(),
						null,
						true,
						bootValueMapping.getColumnInsertability(),
						bootValueMapping.getColumnUpdateability(),
						creationProcess
				);
				attributeMapping.setForeignKeyDescriptor( embeddedForeignKeyDescriptor );
				attributeMapping.setupCircularFetchModelPart( creationProcess );
			}
			else {
				throw new UnsupportedOperationException(
						"Support for foreign-keys based on `" + modelPart + "` not yet implemented: " +
								bootProperty.getPersistentClass().getEntityName() + " -> " + bootProperty.getName()
				);
			}
			return true;
		}

		final var fkTarget =
				bootValueMapping.isReferenceToPrimaryKey()
						? referencedEntityDescriptor.getIdentifierMappingForJoin()
						: referencedEntityDescriptor.findByPath( bootValueMapping.getReferencedPropertyName() );

		final var simpleFkTarget = fkTarget.asBasicValuedModelPart();
		if ( simpleFkTarget != null ) {
			final var columnIterator = bootValueMapping.getSelectables().iterator();
			final var table = bootValueMapping.getTable();
			final String tableExpression = getTableIdentifierExpression( table, creationProcess );
			final PropertyAccess declaringKeyPropertyAccess = getDeclaringKeyPropertyAccess(

View on GitHub (pinned to fad1729dce)

Solutions

  1. Base the foreign key on supported model parts (basic attributes, to-one associations); restructure the referenced mapping.

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/20dd57e3fbdcafbd. Report an issue: GitHub.