{"record":{"id":"c8ffa0a038f8525a","repo":"hibernate/hibernate-orm","slug":"operand-of-is-empty-operator-must-be-a-plural-pa","errorCode":null,"errorMessage":"Operand of 'is empty' operator must be a plural path","messagePattern":"Operand of 'is empty' operator must be a plural path","errorType":"exception","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java","lineNumber":2530,"sourceCode":"\t\t\t\t(SqmExpression<?>) ctx.expression( 2 ).accept( this ),\n\t\t\t\tctx.NOT() != null,\n\t\t\t\tnodeBuilder()\n\t\t);\n\t}\n\n\t@Override\n\tpublic SqmPredicate visitUnaryIsPredicate(HqlParser.UnaryIsPredicateContext ctx) {\n\t\tfinal var expression = (SqmExpression<?>) ctx.expression().accept( this );\n\t\tfinal var negated = ctx.NOT() != null;\n\t\tfinal var nodeBuilder = nodeBuilder();\n\t\treturn switch ( ((TerminalNode) ctx.getChild( ctx.getChildCount() - 1 )).getSymbol().getType() ) {\n\t\t\tcase HqlParser.NULL -> new SqmNullnessPredicate( expression, negated, nodeBuilder );\n\t\t\tcase HqlParser.EMPTY -> {\n\t\t\t\tif ( expression instanceof SqmPluralValuedSimplePath<?> pluralValuedSimplePath ) {\n\t\t\t\t\tyield new SqmEmptinessPredicate( pluralValuedSimplePath, negated, nodeBuilder );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new SemanticException( \"Operand of 'is empty' operator must be a plural path\", query );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase HqlParser.TRUE -> new SqmTruthnessPredicate( expression, true, negated, nodeBuilder );\n\t\t\tcase HqlParser.FALSE -> new SqmTruthnessPredicate( expression, false, negated, nodeBuilder );\n\t\t\tdefault -> throw new AssertionError( \"Unknown unary is predicate: \" + ctx.getChild( ctx.getChildCount() - 1 ) );\n\t\t};\n\t}\n\n\t@Override\n\tpublic SqmPredicate visitBinaryExpressionPredicate(HqlParser.BinaryExpressionPredicateContext ctx) {\n\t\tfinal var firstSymbol = ((TerminalNode) ctx.getChild( 1 )).getSymbol();\n\t\tfinal boolean negated;\n\t\tfinal Token operationSymbol;\n\t\tif ( firstSymbol.getType() == HqlParser.NOT ) {\n\t\t\tnegated = true;\n\t\t\toperationSymbol = ((TerminalNode) ctx.getChild( 2 )).getSymbol();\n\t\t}\n\t\telse {","sourceCodeStart":2512,"sourceCodeEnd":2548,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L2512-L2548","documentation":"Error \"Operand of 'is empty' operator must be a plural path\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A path expression of the wrong type is used in a collection predicate.","commonSituations":"Applying member of / is empty / includes / intersects / in-array to non-plural expressions.","solutions":["Apply 'is empty' only to collection-valued paths.","Check that the operand is a mapped collection 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-22T09:17:25.309Z"}