hibernate/hibernate-orm · error · ModelsException

Assumed dynamic entity did not define entity-name

Error message

Assumed dynamic entity did not define entity-name

What it means

Error "Assumed dynamic entity did not define entity-name" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/ManagedTypeProcessor.java:92

	// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Entity

	public static void processCompleteEntity(
			JaxbEntityMappingsImpl jaxbRoot,
			JaxbEntityImpl jaxbEntity,
			XmlDocumentContext xmlDocumentContext) {
		final MutableClassDetails classDetails;
		final AccessType classAccessType;
		final AttributeProcessor.MemberAdjuster memberAdjuster;

		final var classDetailsRegistry =
				xmlDocumentContext.getModelBuildingContext()
						.getClassDetailsRegistry();

		if ( isEmpty( jaxbEntity.getClazz() ) ) {
			// no class == dynamic
			if ( isEmpty( jaxbEntity.getName() ) ) {
				throw new ModelsException( "Assumed dynamic entity did not define entity-name" );
			}

			memberAdjuster = ManagedTypeProcessor::adjustDynamicTypeMember;
			classAccessType = AccessType.FIELD;
			classDetails = (MutableClassDetails) ModelsHelper.resolveClassDetails(
					jaxbEntity.getName(),
					xmlDocumentContext,
					classDetailsRegistry,
					() -> {
						final ClassDetails superClass;
						final TypeDetails superType;
						if ( isEmpty( jaxbEntity.getExtends() ) ) {
							superClass = null;
							superType = null;
						}
						else {
							// we expect the super to have been processed first.
							// not worth the effort to support the delay

View on GitHub (pinned to fad1729dce)

Solutions

  1. Set the entity-name attribute on the <entity/> element in the XML mapping for the dynamic entity.

Example fix

Set the entity-name attribute on the <entity/> element in the XML mapping for the dynamic entity.

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/775a79e3ed546da0. Report an issue: GitHub.