{"record":{"id":"b1072bfcf88760dc","repo":"hibernate/hibernate-orm","slug":"unsupported-jakarta-persistence-sql-resultsetmappi","errorCode":null,"errorMessage":"Unsupported jakarta.persistence.sql.ResultSetMapping type : {}","messagePattern":"Unsupported jakarta\\.persistence\\.sql\\.ResultSetMapping type : (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/JpaMappingHelper.java","lineNumber":74,"sourceCode":"\t\t\tresultMapping.addResultBuilder( new ColumnBuilder<>( columnMapping, sessionFactory ) );\n\t\t}\n\t\telse if ( jpaMapping instanceof ConstructorMapping<T> constructorMapping ) {\n\t\t\tresultMapping.addResultBuilder( new ConstructorBuilder<>( constructorMapping, sessionFactory ) );\n\t\t}\n\t\telse if ( jpaMapping instanceof EntityMapping<T> entityMapping ) {\n\t\t\tresultMapping.addResultBuilder( new EntityBuilder<>( entityMapping, sessionFactory ) );\n\t\t}\n\t\telse if ( jpaMapping instanceof TupleMapping tupleMapping ) {\n\t\t\tresultMapping.addResultBuilder( new TupleBuilder( tupleMapping, sessionFactory ) );\n\t\t}\n\t\telse if ( jpaMapping instanceof CompoundMapping compoundMapping ) {\n\t\t\tfor ( int i = 0; i < compoundMapping.elements().length; i++ ) {\n\t\t\t\tfinal MappingElement<?> mappingElement = compoundMapping.elements()[i];\n\t\t\t\tresultMapping.addResultBuilder( toHibernateBuilder( mappingElement, sessionFactory ) );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"Unsupported jakarta.persistence.sql.ResultSetMapping type : \" + jpaMapping.getClass().getName() );\n\t\t}\n\t}\n\n\tpublic static <T> MappingElementBuilder<T> toHibernateBuilder(\n\t\t\tjakarta.persistence.sql.MappingElement<T> jpaMapping,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tif ( jpaMapping instanceof ColumnMapping<T> columnMapping ) {\n\t\t\treturn new ColumnBuilder<>( columnMapping, sessionFactory );\n\t\t}\n\t\telse if ( jpaMapping instanceof ConstructorMapping<T> constructorMapping ) {\n\t\t\treturn new ConstructorBuilder<>( constructorMapping, sessionFactory );\n\t\t}\n\t\telse if ( jpaMapping instanceof EntityMapping<T> entityMapping ) {\n\t\t\treturn new EntityBuilder<>( entityMapping, sessionFactory );\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"Unsupported jakarta.persistence.sql.MappingElement type : \" + jpaMapping.getClass().getName() );\n\t\t}","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/results/internal/jpa/JpaMappingHelper.java#L56-L92","documentation":"Error \"Unsupported jakarta.persistence.sql.ResultSetMapping type : {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A native SQL result-set mapping is invalid or misapplied: Unsupported jakarta.persistence.sql.ResultSetMapping type : <value>","commonSituations":"Using @SqlResultSetMapping with non-native queries, aliases missing from the ResultSet, duplicated aliases, composite-path attribute results, or unknown mapped attributes/columns.","solutions":["The ResultSetMapping type is not supported. Use a supported jakarta.persistence.sql mapping type."],"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"}