hibernate/hibernate-orm · error · UnsupportedOperationException

Unexpected plural-attribute element type : %s

Error message

Unexpected plural-attribute element type : %s

What it means

Error "Unexpected plural-attribute element type : %s" thrown in hibernate/hibernate-orm.

Source

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

			}
			else {
				throw new AssertionFailure( "Unexpected association type" );
			}

			creationProcess.registerInitializationCallback(
					"PluralAttributeMapping( " + elementDescriptor.getNavigableRole() + ") - element descriptor",
					() -> elementDescriptor.finishInitialization(
							collectionDescriptor,
							bootDescriptor,
							elementEntityType.getRHSUniqueKeyPropertyName(),
							creationProcess
					)
			);

			return elementDescriptor;
		}

		throw new UnsupportedOperationException(
				"Unexpected plural-attribute element type : " + element.getClass().getName()
		);
	}

	public static EmbeddedAttributeMapping createInverseModelPart(
			EmbeddableValuedModelPart modelPart,
			ManagedMappingType keyDeclaringType,
			TableGroupProducer declaringTableGroupProducer,
			SelectableMappings selectableMappings,
			MappingModelCreationProcess creationProcess) {
		final var embeddableTypeDescriptor = modelPart.getEmbeddableTypeDescriptor();
		if ( modelPart instanceof NonAggregatedIdentifierMapping nonAggregatedIdentifierMapping ) {
			return new InverseNonAggregatedIdentifierMapping(
					keyDeclaringType,
					declaringTableGroupProducer,
					selectableMappings,
					nonAggregatedIdentifierMapping,
					embeddableTypeDescriptor,

View on GitHub (pinned to fad1729dce)

Solutions

  1. Check the collection element mapping: it must be basic, embeddable, or an entity association; fix conflicting annotations on the element.

When it happens

Trigger: Thrown when a collection's element mapping is neither basic, embeddable, entity, nor any, so no collection part can be created for it.

Common situations: See trigger scenarios.


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