{"record":{"id":"b2396dd0c23804bb","repo":"hibernate/hibernate-orm","slug":"specified-attribute-mapping-s-s-not-a-basic-at","errorCode":null,"errorMessage":"Specified attribute mapping [%s.%s] not a basic attribute: %s","messagePattern":"Specified attribute mapping \\[(.+?)\\.(.+?)\\] not a basic attribute: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/results/internal/Builders.java","lineNumber":174,"sourceCode":"\t\t}\n\n\t\tfinal MappingMetamodelImplementor mappingMetamodel = sessionFactory.getMappingMetamodel();\n\t\tfinal String fullEntityName = mappingMetamodel.getImportedName( entityName );\n\t\tfinal EntityPersister entityMapping = mappingMetamodel.findEntityDescriptor( fullEntityName );\n\t\tif ( entityMapping == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Could not locate entity mapping : \" + fullEntityName );\n\t\t}\n\n\t\tfinal AttributeMapping attributeMapping = entityMapping.findAttributeMapping( attributePath );\n\t\tif ( attributeMapping == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Could not locate attribute mapping : \" + fullEntityName + \".\" + attributePath );\n\t\t}\n\n\t\tif ( attributeMapping instanceof SingularAttributeMapping singularAttributeMapping ) {\n\t\t\treturn new DynamicResultBuilderAttribute( singularAttributeMapping, columnAlias, fullEntityName, attributePath );\n\t\t}\n\n\t\tthrow new IllegalArgumentException(\n\t\t\t\tString.format(\n\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\"Specified attribute mapping [%s.%s] not a basic attribute: %s\",\n\t\t\t\t\t\tfullEntityName,\n\t\t\t\t\t\tattributePath,\n\t\t\t\t\t\tattributeMapping\n\t\t\t\t)\n\t\t);\n\t}\n\n\tpublic static ResultBuilder attributeResult(\n\t\t\tString columnAlias,\n\t\t\tSingularAttribute<?, ?> attribute,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tif ( ! ( attribute.getDeclaringType() instanceof EntityType<?> entityType ) ) {\n\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\"Support for defining a NativeQuery attribute result based on a composite path is not yet implemented\"\n\t\t\t);","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/results/internal/Builders.java#L156-L192","documentation":"Error \"Specified attribute mapping [%s.%s] not a basic attribute: %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Specified attribute mapping [<value>.<value>] not a basic attribute: <value>","commonSituations":"Application code or configuration calls the query API in a way that violates its documented contract; the interpolated values in the message identify the offending input.","solutions":["The mapped attribute is not basic. Use a basic (column-mapped) attribute for this result mapping."],"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"}