{"record":{"id":"4d2d297995eb280f","repo":"hibernate/hibernate-orm","slug":"not-an-embedded-attribute","errorCode":null,"errorMessage":"Not an embedded attribute: {}","messagePattern":"Not an embedded attribute: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/EntityBuilder.java","lineNumber":107,"sourceCode":"\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( memberMapping instanceof EmbeddedMapping<?,?> embeddedMapping ) {\n\t\t\t\tfinal var attributeMapping =\n\t\t\t\t\t\t\t\tentityDescriptor.findSubPart( embeddedMapping.name() );\n\t\t\t\tif ( !identifierFetchHandler.handleMember( embeddedMapping ) ) {\n\t\t\t\t\tif ( attributeMapping instanceof EmbeddableValuedModelPart modelPart ) {\n\t\t\t\t\t\tattributeFetchBuilders.put(\n\t\t\t\t\t\t\t\tembeddedMapping.name(),\n\t\t\t\t\t\t\t\tnew CompleteFetchBuilderEmbeddableValuedModelPart(\n\t\t\t\t\t\t\t\t\t\trootPath.append( attributeMapping.getPartName() ),\n\t\t\t\t\t\t\t\t\t\tmodelPart,\n\t\t\t\t\t\t\t\t\t\textractColumnNames( embeddedMapping, modelPart )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthrow new IllegalArgumentException( \"Not an embedded attribute: \"\n\t\t\t\t\t\t\t\t+ attributeMapping.getNavigableRole().getFullPath() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new IllegalArgumentException( \"Unrecognized member mapping type: \"\n\t\t\t\t\t\t\t+ memberMapping.getClass().getName() );\n\t\t\t}\n\t\t}\n\n\t\tthis.identifierFetchBuilder = identifierFetchHandler.buildFetchBuilder();\n\t}\n\n\tprivate static List<String> extractColumnNames(\n\t\t\tEmbeddedMapping<?, ?> embeddedMapping,\n\t\t\tEmbeddableValuedModelPart modelPart) {\n\t\tfinal var columnNames = new String[modelPart.getJdbcTypeCount()];\n\t\tcollectColumnNames( embeddedMapping, modelPart.getEmbeddableTypeDescriptor(), 0, columnNames );","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/EntityBuilder.java#L89-L125","documentation":"Error \"Not an embedded attribute: {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A JPA result mapping for an embedded/identifier attribute is invalid: Not an embedded attribute: <value>","commonSituations":"@SqlResultSetMapping/@MappingElement definitions referencing non-embedded attributes, missing column names, or duplicate member mappings.","solutions":["The attribute is not an embedded attribute. Use embedded result mappings only for @Embedded attributes."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}