{"record":{"id":"23d6f5ce8925c046","repo":"hibernate/hibernate-orm","slug":"expecting-domain-model-path-but-found-consum","errorCode":null,"errorMessage":"Expecting domain-model path, but found: \" + consumedPart","messagePattern":"Expecting domain-model path, but found: \" \\+ consumedPart","errorType":"exception","errorClass":"PathException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":6163,"sourceCode":"\tprivate void checkPluralPath(SqmPath<?> pluralAttributePath, SqmPathSource<?> referencedPathSource, TerminalNode firstNode) {\n\t\tif ( !( referencedPathSource instanceof PluralPersistentAttribute<?, ?, ?> ) ) {\n\t\t\tthrow new FunctionArgumentException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\"Argument of '%s' is not a plural path '%s'\",\n\t\t\t\t\t\t\tfirstNode.getSymbol().getText(),\n\t\t\t\t\t\t\tpluralAttributePath.getNavigablePath()\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate SqmPath<?> consumeDomainPath(HqlParser.PathContext parserPath) {\n\t\tfinal var consumedPart = (SemanticPathPart) parserPath.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\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<?> ) {","sourceCodeStart":6145,"sourceCodeEnd":6181,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L6145-L6181","documentation":"Error \"Expecting domain-model path, but found: \" + consumedPart\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Expecting domain-model path, but found: \" + consumedPart","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":["Expected a domain-model path but found something else. Ensure the path starts from an identification variable or entity root and navigates mapped attributes."],"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"}