{"record":{"id":"aae2643fafe32ce3","repo":"hibernate/hibernate-orm","slug":"expecting-managedtype-or-any-valued-path-sqm","errorCode":null,"errorMessage":"Expecting ManagedType or @Any valued path [\" + sqmPath.getNavigablePath() + \"], but found: \" + pathType","messagePattern":"Expecting ManagedType or @Any valued path \\[\" \\+ sqmPath\\.getNavigablePath\\(\\) \\+ \"\\], but found: \" \\+ pathType","errorType":"exception","errorClass":"PathException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":6185,"sourceCode":"\n\tprivate SqmPath<?> consumeDomainPath(HqlParser.SimplePathContext sequence) {\n\t\tfinal var consumedPart = (SemanticPathPart) sequence.accept( this );\n\t\tif ( consumedPart instanceof SqmPath<?> sqmPath ) {\n\t\t\treturn sqmPath;\n\t\t}\n\t\telse {\n\t\t\tthrow new PathException( \"Expecting domain-model path, but found: \" + consumedPart );\n\t\t}\n\t}\n\n\tprivate SqmPath<?> consumeManagedTypeReference(HqlParser.PathContext parserPath) {\n\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) {","sourceCodeStart":6167,"sourceCodeEnd":6203,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L6167-L6203","documentation":"Error \"Expecting ManagedType or @Any valued path [\" + sqmPath.getNavigablePath() + \"], but found: \" + pathType\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Expecting ManagedType or @Any valued path [\" + sqmPath.getNavigablePath() + \"], but found: \" + pathType","commonSituations":"Application code or configuration calls the query API in a way that violates its documented contract; the interpolated values in the message identify the offending input.","solutions":["The path must resolve to a managed type or an @Any-valued attribute. Check the mapping of the referenced attribute."],"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-22T14:17:55.899Z"}