{"record":{"id":"4b2d4771b483daea","repo":"hibernate/hibernate-orm","slug":"list-index-has-no-attributes","errorCode":null,"errorMessage":"List index has no attributes","messagePattern":"List index has no attributes","errorType":"exception","errorClass":"TerminalPathException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":6094,"sourceCode":"\t\t}\n\n\t\tSqmPath<?> result;\n\t\tif ( sqmPath instanceof SqmMapJoin<?, ?, ?> sqmMapJoin ) {\n\t\t\tif ( consumer instanceof QualifiedJoinPathConsumer pathConsumer ) {\n\t\t\t\tif ( madeNested && !hasContinuation ) {\n\t\t\t\t\t// Reset the nested state before consuming the terminal identifier\n\t\t\t\t\tpathConsumer.setNested( false );\n\t\t\t\t}\n\t\t\t\tconsumer.consumeIdentifier( CollectionPart.Nature.INDEX.getName(), false, !hasContinuation );\n\t\t\t\tresult = (SqmPath<?>) consumer.getConsumedPart();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult = sqmMapJoin.key();\n\t\t\t}\n\t\t}\n\t\telse if ( sqmPath instanceof SqmListJoin<?, ?> listJoin ) {\n\t\t\tif ( hasContinuation ) {\n\t\t\t\tthrow new TerminalPathException(\"List index has no attributes\");\n\t\t\t}\n\t\t\tresult = listJoin.resolvePathPart( CollectionPart.Nature.INDEX.getName(), true, this );\n\t\t}\n\t\telse if ( sqmPath instanceof SqmFunctionRoot<?> functionRoot ) {\n\t\t\tif ( hasContinuation ) {\n\t\t\t\tthrow new TerminalPathException(\"List index has no attributes\");\n\t\t\t}\n\t\t\tresult = functionRoot.index();\n\t\t}\n\t\telse if ( sqmPath instanceof SqmFunctionJoin<?> functionJoin ) {\n\t\t\tif ( hasContinuation ) {\n\t\t\t\tthrow new TerminalPathException(\"List index has no attributes\");\n\t\t\t}\n\t\t\tresult = functionJoin.index();\n\t\t}\n\t\telse {\n\t\t\tassert sqmPath instanceof SqmPluralValuedSimplePath;\n\t\t\tfinal SqmPluralValuedSimplePath<?> mapPath = (SqmPluralValuedSimplePath<?>) sqmPath;","sourceCodeStart":6076,"sourceCodeEnd":6112,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L6076-L6112","documentation":"Error \"List index has no attributes\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An attribute path is dereferenced from a list index: List index has no attributes","commonSituations":"Navigating 'list[index].something' where the index has no attributes.","solutions":["A list index has no attributes to navigate. Do not dereference attributes of the index expression; use the index value directly."],"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"}