hibernate/hibernate-orm · error · MappingException

Unexpected collection element type : <pluralAttributeJaxbMap

Error message

Unexpected collection element type : <pluralAttributeJaxbMapping.getName()>

What it means

Error "Unexpected collection element type : <pluralAttributeJaxbMapping.getName()>" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/AbstractPluralAttributeSourceImpl.java:236

			);
		}
		else if ( pluralAttributeJaxbMapping.getManyToMany() != null ) {
			return new PluralAttributeElementSourceManyToManyImpl(
					sourceMappingDocument(),
					this,
					pluralAttributeJaxbMapping.getManyToMany()
			);
		}
		else if ( pluralAttributeJaxbMapping.getManyToAny() != null ) {
			return new PluralAttributeElementSourceManyToAnyImpl(
					sourceMappingDocument(),
					this,
					pluralAttributeJaxbMapping.getManyToAny(),
					pluralAttributeJaxbMapping.getCascade()
			);
		}
		else {
			throw new MappingException(
					"Unexpected collection element type : " + pluralAttributeJaxbMapping.getName(),
					sourceMappingDocument().getOrigin()
			);
		}
	}

	@Override
	public AttributePath getAttributePath() {
		return attributePath;
	}

	@Override
	public AttributeRole getAttributeRole() {
		return attributeRole;
	}

	@Override
	public boolean usesJoinTable() {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Use a supported collection element mapping (<element/>, <one-to-many/>, <many-to-many/>, <composite-element/>, <many-to-any/>) in the hbm.xml collection.

Example fix

Use a supported collection element mapping (<element/>, <one-to-many/>, <many-to-many/>, <composite-element/>, <many-to-any/>) in the hbm.xml collection.

When it happens

Trigger: An hbm.xml / orm.xml mapping document violates a mapping rule during bootstrap.

Common situations: Legacy XML mappings with invalid combinations (column+formula, mixed inheritance, missing identifiers, bad extends references).


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