{"record":{"id":"a4c2bae0af90852c","repo":"hibernate/hibernate-orm","slug":"expecting-plural-attribute-valued-path-sqmpat","errorCode":null,"errorMessage":"Expecting plural attribute valued path [\" + sqmPath.getNavigablePath() + \"], but found: \" + pathSource.getPathType()","messagePattern":"Expecting plural attribute valued path \\[\" \\+ sqmPath\\.getNavigablePath\\(\\) \\+ \"\\], but found: \" \\+ pathSource\\.getPathType\\(\\)","errorType":"exception","errorClass":"PathException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":6197,"sourceCode":"\t\tfinal var sqmPath = consumeDomainPath( parserPath );\n\t\tfinal var pathType = sqmPath.getReferencedPathSource().getPathType();\n\t\tif ( pathType instanceof ManagedDomainType<?> || pathType instanceof AnyMappingDomainType<?> ) {\n\t\t\treturn sqmPath;\n\t\t}\n\t\telse {\n\t\t\tthrow new PathException( \"Expecting ManagedType or @Any valued path [\"\n\t\t\t\t\t\t+ sqmPath.getNavigablePath() + \"], but found: \" + pathType );\n\t\t}\n\t}\n\n\tprivate SqmPath<?> consumePluralAttributeReference(HqlParser.PathContext parserPath) {\n\t\tfinal var sqmPath = consumeDomainPath( parserPath );\n\t\tfinal var pathSource = sqmPath.getReferencedPathSource();\n\t\tif ( pathSource instanceof PluralPersistentAttribute ) {\n\t\t\treturn sqmPath;\n\t\t}\n\t\telse {\n\t\t\tthrow new PathException( \"Expecting plural attribute valued path [\"\n\t\t\t\t\t\t+ sqmPath.getNavigablePath() + \"], but found: \"\n\t\t\t\t\t\t+ pathSource.getPathType() );\n\t\t}\n\t}\n\n\tprivate void checkFQNEntityNameJpaComplianceViolationIfNeeded(String name, EntityDomainType<?> entityDescriptor) {\n\t\tif ( getCreationOptions().useStrictJpaCompliance() && ! name.equals( entityDescriptor.getName() ) ) {\n\t\t\t// FQN is the only possible reason\n\t\t\tthrow new StrictJpaComplianceViolation(\"Encountered FQN entity name [\" + name + \"], \" +\n\t\t\t\t\t\"but strict JPQL compliance was requested ( [\" + entityDescriptor.getName() + \"] should be used instead )\",\n\t\t\t\t\tStrictJpaComplianceViolation.Type.FQN_ENTITY_NAME\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate enum ParameterStyle {\n\t\tUNKNOWN {\n\t\t\t@Override","sourceCodeStart":6179,"sourceCodeEnd":6215,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L6179-L6215","documentation":"Error \"Expecting plural attribute valued path [\" + sqmPath.getNavigablePath() + \"], but found: \" + pathSource.getPathType()\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A collection-typed path is required but not found: Expecting plural attribute valued path [\" + sqmPath.getNavigablePath() + \"], but found: \" + pathSource.getPathType()","commonSituations":"Applying collection operations (elements/indices/key/value/index, slice, member of) to singular paths, or to joined lists/maps that are not compound/indexed paths.","solutions":["The path must resolve to a plural (collection) attribute. Verify the referenced attribute is collection-valued."],"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"}