{"record":{"id":"e57e923285b95182","repo":"hibernate/hibernate-orm","slug":"plural-attribute-is-not-indexed-list-map","errorCode":null,"errorMessage":"Plural attribute [{}] is not indexed (list / map)","messagePattern":"Plural attribute \\[(.+?)\\] is not indexed \\(list / map\\)","errorType":"exception","errorClass":"NotIndexedCollectionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/PluralPersistentAttribute.java","lineNumber":30,"sourceCode":"\n/**\n * Extension of the JPA-defined {@link PluralAttribute} interface.\n *\n * @author Steve Ebersole\n */\npublic interface PluralPersistentAttribute<D, C, E>\n\t\textends PersistentAttribute<D, C>, PathSource<E>, PluralAttribute<D, C, E> {\n\t@Override\n\t@Nonnull\n\tManagedDomainType<D> getDeclaringType();\n\n\t@Nonnull\n\tCollectionClassification getCollectionClassification();\n\n\tPathSource<E> getElementPathSource();\n\n\tdefault PathSource<?> getIndexPathSource() {\n\t\tthrow new NotIndexedCollectionException(\n\t\t\t\t\"Plural attribute [\" +  getPathName() + \"] is not indexed (list / map)\"\n\t\t);\n\t}\n\n\t@Override\n\t@Nonnull\n\tSimpleDomainType<E> getElementType();\n\n\t@Override\n\t@Nonnull\n\tSimpleDomainType<E> getValueGraphType();\n\n\t@Override\n\tdefault SimpleDomainType<?> getKeyGraphType() {\n\t\tthrow new NotIndexedCollectionException(\n\t\t\t\t\"Plural attribute [\" +  getPathName() + \"] is not indexed (list / map)\"\n\t\t);\n\t}","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/PluralPersistentAttribute.java#L12-L48","documentation":"Error \"Plural attribute [{}] is not indexed (list / map)\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when code asks a plural attribute for its index (list/map key) part but the attribute is a non-indexed collection (bag/set).","commonSituations":"See trigger scenarios.","solutions":["Only call index/key operations on indexed collections (List or Map); change the attribute to List/Map or avoid the index access."],"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"}