{"record":{"id":"6cbb424fbdb94a29","repo":"hibernate/hibernate-orm","slug":"illegal-path-ctx-gettext","errorCode":null,"errorMessage":"Illegal path '\" + ctx.getText() + \"'","messagePattern":"Illegal path '\" \\+ ctx\\.getText\\(\\) \\+ \"'","errorType":"exception","errorClass":"ParsingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":5752,"sourceCode":"\t\t}\n\t}\n\n\n\t// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t// Path structures\n\n\t@Override\n\tpublic SemanticPathPart visitPath(HqlParser.PathContext ctx) {\n\t\tfinal var syntacticDomainPath = ctx.syntacticDomainPath();\n\t\tfinal var generalPathFragment = ctx.generalPathFragment();\n\t\tif ( syntacticDomainPath != null ) {\n\t\t\treturn visitPathContinuation( visitSyntacticDomainPath( syntacticDomainPath ), ctx.pathContinuation() );\n\t\t}\n\t\telse if ( generalPathFragment != null ) {\n\t\t\treturn (SemanticPathPart) generalPathFragment.accept(this);\n\t\t}\n\t\telse {\n\t\t\tthrow new ParsingException(\"Illegal path '\" + ctx.getText() + \"'\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic SemanticPathPart visitGeneralPathFragment(HqlParser.GeneralPathFragmentContext ctx) {\n\t\treturn visitIndexedPathAccessFragment( visitSimplePath( ctx.simplePath() ), ctx.indexedPathAccessFragment() );\n\t}\n\n\t@Override\n\tpublic SemanticPathPart visitSyntacticDomainPath(HqlParser.SyntacticDomainPathContext ctx) {\n\t\tif ( ctx.treatedNavigablePath() != null ) {\n\t\t\treturn visitTreatedNavigablePath( ctx.treatedNavigablePath() );\n\t\t}\n\t\telse if ( ctx.collectionValueNavigablePath() != null ) {\n\t\t\treturn visitCollectionValueNavigablePath( ctx.collectionValueNavigablePath() );\n\t\t}\n\t\telse if ( ctx.mapKeyNavigablePath() != null ) {\n\t\t\treturn visitMapKeyNavigablePath( ctx.mapKeyNavigablePath() );","sourceCodeStart":5734,"sourceCodeEnd":5770,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L5734-L5770","documentation":"Error \"Illegal path '\" + ctx.getText() + \"'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Illegal path '\" + ctx.getText() + \"'","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 is illegal in this context. Verify the path exists on the entity and is used in a context that allows it."],"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"}