hibernate/hibernate-orm · error · IllegalArgumentException

No column name specified for embedded attribute selectable:

Error message

No column name specified for embedded attribute selectable: {}

What it means

Error "No column name specified for embedded attribute selectable: {}" thrown in hibernate/hibernate-orm.

Source

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

				}
			}
			else {
				throw new IllegalArgumentException( "Unrecognized member mapping type: "
							+ memberMapping.getClass().getName() );
			}
		}

		this.identifierFetchBuilder = identifierFetchHandler.buildFetchBuilder();
	}

	private static List<String> extractColumnNames(
			EmbeddedMapping<?, ?> embeddedMapping,
			EmbeddableValuedModelPart modelPart) {
		final var columnNames = new String[modelPart.getJdbcTypeCount()];
		collectColumnNames( embeddedMapping, modelPart.getEmbeddableTypeDescriptor(), 0, columnNames );
		for ( int i = 0; i < columnNames.length; i++ ) {
			if ( columnNames[i] == null ) {
				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(

View on GitHub (pinned to fad1729dce)

Solutions

  1. No column name was given for an embedded attribute selectable. Specify a column for each selectable in the embedded mapping.

When it happens

Trigger: A JPA result mapping for an embedded/identifier attribute is invalid: No column name specified for embedded attribute selectable: <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/9ee8a2d36f361403. Report an issue: GitHub.