@Test public void testMemberOfOperator() throws Exception { List<Path.PathElement> path = Arrays.asList( new Path.PathElement(Book.class, String.class, "awards") ); FilterPredicate p1 = new FilterPredicate(new Path(path), Operator.HASMEMBER, Arrays.asList("awards1")); FilterPredicate p2 = new FilterPredicate(new Path(path), Operator.HASNOMEMBER, Arrays.asList("awards2")); AndFilterExpression and = new AndFilterExpression(p1, p2); FilterTranslator filterOp = new FilterTranslator(); String query = filterOp.apply(and, false); String p1Params = p1.getParameters().stream() .map(FilterPredicate.FilterParameter::getPlaceholder).collect(Collectors.joining(", ")); String p2Params = p2.getParameters().stream() .map(FilterPredicate.FilterParameter::getPlaceholder).collect(Collectors.joining(", ")); String expected = "WHERE (" + p1Params + " MEMBER OF awards " + "AND " + p2Params + " NOT MEMBER OF awards)"; assertEquals(expected, query); }
@Override public String apply(FilterPredicate filterPredicate) { return apply(filterPredicate, false); }
FilterTranslator implements FilterOperation<String> { @Override public String apply(FilterPredicate filterPredicate) { return apply(filterPredicate, false); } }
FilterTranslator implements FilterOperation<String> { @Override public String apply(FilterPredicate filterPredicate) { return apply(filterPredicate, false); }  }
FilterTranslator implements FilterOperation<String> { @Override public String apply(FilterPredicate filterPredicate) { return apply(filterPredicate, false); }  static void registerJPQLGenerator(Operator op,
                                             JPQLPredicateGenerator generator); static void registerJPQLGenerator(Operator op,
                                             Class<?> entityClass,
                                             String fieldName,
                                             JPQLPredicateGenerator generator); static JPQLPredicateGenerator lookupJPQLGenerator(Operator op,
                                           Class<?> entityClass,
                                           String fieldName); static JPQLPredicateGenerator lookupJPQLGenerator(Operator op); @Override String apply(FilterPredicate filterPredicate); String apply(FilterExpression filterExpression, boolean prefixWithAlias); }
FilterTranslator implements FilterOperation<String> { @Override public String apply(FilterPredicate filterPredicate) { return apply(filterPredicate, false); }  static void registerJPQLGenerator(Operator op,
                                             JPQLPredicateGenerator generator); static void registerJPQLGenerator(Operator op,
                                             Class<?> entityClass,
                                             String fieldName,
                                             JPQLPredicateGenerator generator); static JPQLPredicateGenerator lookupJPQLGenerator(Operator op,
                                           Class<?> entityClass,
                                           String fieldName); static JPQLPredicateGenerator lookupJPQLGenerator(Operator op); @Override String apply(FilterPredicate filterPredicate); String apply(FilterExpression filterExpression, boolean prefixWithAlias);  }