hibernate/hibernate-orm · error · IllegalArgumentException
Not an embedded attribute: {}
Error message
Not an embedded attribute: {} What it means
Error "Not an embedded attribute: {}" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/EntityBuilder.java:107
);
}
}
else if ( memberMapping instanceof EmbeddedMapping<?,?> embeddedMapping ) {
final var attributeMapping =
entityDescriptor.findSubPart( embeddedMapping.name() );
if ( !identifierFetchHandler.handleMember( embeddedMapping ) ) {
if ( attributeMapping instanceof EmbeddableValuedModelPart modelPart ) {
attributeFetchBuilders.put(
embeddedMapping.name(),
new CompleteFetchBuilderEmbeddableValuedModelPart(
rootPath.append( attributeMapping.getPartName() ),
modelPart,
extractColumnNames( embeddedMapping, modelPart )
)
);
}
else {
throw new IllegalArgumentException( "Not an embedded attribute: "
+ attributeMapping.getNavigableRole().getFullPath() );
}
}
}
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 );View on GitHub (pinned to fad1729dce)
Solutions
- The attribute is not an embedded attribute. Use embedded result mappings only for @Embedded attributes.
When it happens
Trigger: A JPA result mapping for an embedded/identifier attribute is invalid: Not an embedded 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/4d2d297995eb280f.
Report an issue: GitHub.