hibernate/hibernate-orm · error · IllegalArgumentException

Embedded result mapping specified unknown attribute

Error message

Embedded result mapping specified unknown attribute: {}

What it means

Lookup failure in collectColumnNames: the embedded result mapping names a field for which no attribute mapping exists on the embeddable type.

Solutions

  1. The embedded result mapping names an unknown attribute. Check the attribute exists on the embeddable.
Defensive patterns

Strategy: validation

When it happens

Trigger: A JPA result mapping for an embedded/identifier attribute is invalid: Embedded result mapping specified unknown attribute: <value>

Common situations: @SqlResultSetMapping/@MappingElement definitions referencing non-embedded attributes, missing column names, or duplicate member mappings.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/EntityBuilder.java:146

				throw new IllegalArgumentException(
						"No column name specified for embedded attribute selectable: "
								+ modelPart.getSelectable( i ).getSelectableName()
				);
			}
		}
		return List.of( columnNames );
	}

	private static void collectColumnNames(
			EmbeddedMapping<?, ?> embeddedMapping,
			ManagedMappingType embeddableMappingType,
			int offset,
			String[] columnNames) {
		for ( var memberMapping : embeddedMapping.fields() ) {
			final String memberName = memberName( memberMapping );
			final var attributeMapping = embeddableMappingType.findAttributeMapping( memberName );
			if ( attributeMapping == null ) {
				throw new IllegalArgumentException(
						"Embedded result mapping specified unknown attribute: " + memberName
				);
			}
			populateColumnNames(
					offset + getAttributeOffset( embeddableMappingType, memberName ),
					columnNames,
					memberMapping,
					memberName,
					attributeMapping
			);
		}
	}

	private static void populateColumnNames(
			int offset,
			String[] columnNames,
			MemberMapping<?> memberMapping,
			String memberName,

View on GitHub (pinned to fad1729dce)