{"record":{"id":"b79326ad3dcb4c9e","repo":"hibernate/hibernate-orm","slug":"operand-of-member-of-operator-must-be-a-plural-p","errorCode":null,"errorMessage":"Operand of 'member of' operator must be a plural path","messagePattern":"Operand of 'member of' 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":3343,"sourceCode":"\t\t\t}\n\t\t\treturn new SqmLiteral<>( escape.charAt( 0 ), characterType, nodeBuilder() );\n\t\t}\n\t}\n\n\t@Override\n\tpublic SqmPredicate visitMemberOfPredicate(HqlParser.MemberOfPredicateContext ctx) {\n\t\tfinal boolean negated = ctx.NOT() != null;\n\t\tif ( consumeDomainPath( ctx.path() )\n\t\t\t\tinstanceof SqmPluralValuedSimplePath<?> pluralValuedSimplePath ) {\n\t\t\treturn new SqmMemberOfPredicate(\n\t\t\t\t\t(SqmExpression<?>) ctx.expression().accept( this ),\n\t\t\t\t\tpluralValuedSimplePath,\n\t\t\t\t\tnegated,\n\t\t\t\t\tnodeBuilder()\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tthrow new SemanticException( \"Operand of 'member of' operator must be a plural path\", query );\n\t\t}\n\t}\n\n\t@Override\n\t@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic SqmPredicate visitInPredicate(HqlParser.InPredicateContext ctx) {\n\t\tfinal boolean negated = ctx.getChildCount() == 4;\n\t\tfinal var testExpression = (SqmExpression<?>) ctx.expression().accept( this );\n\t\tfinal var inListContext = ctx.inList();\n\t\tif ( inListContext instanceof HqlParser.ExplicitTupleInListContext tupleExpressionListContext ) {\n\t\t\tfinal int size = tupleExpressionListContext.getChildCount();\n\t\t\tfinal int estimatedSize = size >> 1;\n\t\t\tfinal String testExpressionJavaType = testExpression.getJavaTypeName();\n\t\t\tfinal boolean isEnum = testExpression.isEnum();\n\t\t\t// Multivalued bindings are only allowed if there is a single list item, hence size 3 (LP, RP and param)\n\t\t\tparameterDeclarationContextStack.push( () -> size == 3 );\n\t\t\ttry {\n\t\t\t\tfinal List<SqmExpression<?>> listExpressions = new ArrayList<>( estimatedSize );","sourceCodeStart":3325,"sourceCodeEnd":3361,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java#L3325-L3361","documentation":"Error \"Operand of 'member of' 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 'member of' only to collection-valued paths.","Check that the path 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"}