{"record":{"id":"75906b628228102f","repo":"hibernate/hibernate-orm","slug":"support-for-defining-a-nativequery-attribute-resul","errorCode":null,"errorMessage":"Support for defining a NativeQuery attribute result based on a composite path is not yet implemented","messagePattern":"Support for defining a NativeQuery attribute result based on a composite path is not yet implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/results/internal/Builders.java","lineNumber":153,"sourceCode":"\tpublic static ResultBuilderBasicValued scalar(int position, BasicType<?> type) {\n\t\t// will be needed for interpreting legacy HBM <resultset/> mappings\n\t\treturn new DynamicResultBuilderBasicStandard( position, type );\n\t}\n\n\tpublic static <J> DynamicResultBuilderInstantiation<J> instantiation(Class<J> targetJavaType, SessionFactoryImplementor factory) {\n\t\tfinal var targetJtd =\n\t\t\t\tfactory.getTypeConfiguration().getJavaTypeRegistry()\n\t\t\t\t\t\t.resolveDescriptor( targetJavaType );\n\t\treturn new DynamicResultBuilderInstantiation<>( targetJtd );\n\t}\n\n\tpublic static ResultBuilder attributeResult(\n\t\t\tString columnAlias,\n\t\t\tString entityName,\n\t\t\tString attributePath,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tif ( attributePath.contains( \".\" ) ) {\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);\n\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 );","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/results/internal/Builders.java#L135-L171","documentation":"Error \"Support for defining a NativeQuery attribute result based on a composite path is not yet implemented\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A code path that Hibernate has not implemented is exercised: Support for defining a NativeQuery attribute result based on a composite path is not yet implemented","commonSituations":"Using newer/edge API features (certain projections, specifications, fetch mementos, composite-path native mappings, null keys in key-based pagination) that are present but not yet implemented.","solutions":["Native query attribute results on composite paths are not implemented. Map the composite columns individually."],"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"}