{"record":{"id":"cbe90121879fca0b","repo":"hibernate/hibernate-orm","slug":"resultset-mapping-specified-selected-alias-wh","errorCode":null,"errorMessage":"ResultSet mapping specified selected alias '{}' which was not part of the ResultSet","messagePattern":"ResultSet mapping specified selected alias '(.+?)' which was not part of the ResultSet","errorType":"exception","errorClass":"MissingSqlSelectionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/results/internal/complete/CompleteFetchBuilderBasicPart.java","lineNumber":110,"sourceCode":"\t\t);\n\n\t\treturn (BasicFetch<?>) parent.generateFetchableFetch(\n\t\t\t\treferencedModelPart,\n\t\t\t\tfetchPath,\n\t\t\t\tFetchTiming.IMMEDIATE,\n\t\t\t\ttrue,\n\t\t\t\tselectedAlias,\n\t\t\t\tdomainResultCreationState\n\t\t);\n\t}\n\n\tprivate int jdbcPosition(JdbcValuesMetadata jdbcResultsMetadata, DomainResultCreationStateImpl creationStateImpl) {\n\t\tif ( selectionAlias != null ) {\n\t\t\ttry {\n\t\t\t\treturn jdbcResultsMetadata.resolveColumnPosition( selectionAlias );\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow new MissingSqlSelectionException(\n\t\t\t\t\t\t\"ResultSet mapping specified selected alias '\" + selectionAlias\n\t\t\t\t\t\t\t\t+ \"' which was not part of the ResultSet\",\n\t\t\t\t\t\te\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ( !creationStateImpl.arePositionalSelectionsAllowed() ) {\n\t\t\t\tthrow new AssertionFailure( \"Positional SQL selection resolution not allowed\" );\n\t\t\t}\n\t\t\treturn creationStateImpl.getNumberOfProcessedSelections() + 1;\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean equals(Object object) {\n\t\tif ( this == object ) {\n\t\t\treturn true;","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/results/internal/complete/CompleteFetchBuilderBasicPart.java#L92-L128","documentation":"Error \"ResultSet mapping specified selected alias '{}' which was not part of the ResultSet\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A native SQL result-set mapping is invalid or misapplied: ResultSet mapping specified selected alias '<value>' which was not part of the ResultSet","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 result-set mapping references a selected alias not present in the ResultSet. Add the alias to the SQL select list or fix the 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"}