{"record":{"id":"7d0b47dc8a2be107","repo":"hibernate/hibernate-orm","slug":"path-ctx-path-gettext-resolved-to-a-joined","errorCode":null,"errorMessage":"Path '{ctx.path().getText()}' resolved to a joined map instead of a compound path","messagePattern":"Path '(.+?)' resolved to a joined map instead of a compound path","errorType":"exception","errorClass":"FunctionArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":5647,"sourceCode":"\t}\n\n\t@Override\n\tpublic SqmExpression<?> visitElementAggregateFunction(HqlParser.ElementAggregateFunctionContext ctx) {\n\t\tif ( creationOptions.useStrictJpaCompliance() ) {\n\t\t\tthrow new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.HQL_COLLECTION_FUNCTION );\n\t\t}\n\n\t\t// the actual function name might be 'minelement' or 'maxelement', so trim it\n\t\tfinal String functionName = ctx.getChild(0).getText().substring(0, 3);\n\n\t\tfinal var path = consumePluralAttributeReference( ctx.path() );\n\t\tif ( path instanceof SqmPluralValuedSimplePath<?> pluralPath ) {\n\t\t\treturn new SqmElementAggregateFunction<>( pluralPath, functionName );\n\t\t}\n\t\telse {\n\t\t\t// elements() and values() and only apply to compound paths\n\t\t\tif ( path instanceof SqmMapJoin ) {\n\t\t\t\tthrow new FunctionArgumentException( \"Path '\" + ctx.path().getText()\n\t\t\t\t\t\t+ \"' resolved to a joined map instead of a compound path\" );\n\t\t\t}\n\t\t\telse if ( path instanceof SqmListJoin ) {\n\t\t\t\tthrow new FunctionArgumentException( \"Path '\" + ctx.path().getText()\n\t\t\t\t\t\t+ \"' resolved to a joined list instead of a compound path\" );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new FunctionArgumentException( \"Path '\" + ctx.path().getText()\n\t\t\t\t\t\t+ \"' did not resolve to a many-valued attribute\" );\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic SqmExpression<?> visitIndexAggregateFunction(HqlParser.IndexAggregateFunctionContext ctx) {\n\t\tif ( creationOptions.useStrictJpaCompliance() ) {\n\t\t\tthrow new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.HQL_COLLECTION_FUNCTION );\n\t\t}","sourceCodeStart":5629,"sourceCodeEnd":5665,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L5629-L5665","documentation":"Error \"Path '{ctx.path().getText()}' resolved to a joined map instead of a compound path\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Path '<value>' resolved to a joined map instead of a compound path","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 resolved to a joined map where a compound path was expected. Navigate the map with key()/value()/entry() or index it explicitly instead of treating it as a compound path."],"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"}