@Test public void shouldBuildUngroupedAndOr() { ConditionalCriteria criteria = criteriaFor(Person.class).withProperty(aaa()).eq("A").and().withProperty(bbb()) .eq("B") .or() .withProperty(ccc()).eq("C") .buildSingle(); assertEquals(ConditionalCriteria.Operator.Or, criteria.getOperator()); ConditionalCriteria left1 = (ConditionalCriteria) criteria.getFirstOperant(); assertEquals(ConditionalCriteria.Operator.And, left1.getOperator()); ConditionalCriteria right1 = (ConditionalCriteria) criteria.getSecondOperant(); assertEquals(ConditionalCriteria.Operator.Equal, right1.getOperator()); assertEquals("ccc", right1.property.getName()); assertEquals("C", right1.getFirstOperant()); }
public static <T> ConditionRoot<T> criteriaFor(Class<T> clazz) { return new ConditionalCriteriaBuilder<T>().new RootBuilderImpl(); }
ConditionalCriteriaBuilder { public static <T> ConditionRoot<T> criteriaFor(Class<T> clazz) { return new ConditionalCriteriaBuilder<T>().new RootBuilderImpl(); } }
ConditionalCriteriaBuilder { public static <T> ConditionRoot<T> criteriaFor(Class<T> clazz) { return new ConditionalCriteriaBuilder<T>().new RootBuilderImpl(); } private  ConditionalCriteriaBuilder(); }
ConditionalCriteriaBuilder { public static <T> ConditionRoot<T> criteriaFor(Class<T> clazz) { return new ConditionalCriteriaBuilder<T>().new RootBuilderImpl(); } private  ConditionalCriteriaBuilder(); static ConditionRoot<T> criteriaFor(Class<T> clazz); }
ConditionalCriteriaBuilder { public static <T> ConditionRoot<T> criteriaFor(Class<T> clazz) { return new ConditionalCriteriaBuilder<T>().new RootBuilderImpl(); } private  ConditionalCriteriaBuilder(); static ConditionRoot<T> criteriaFor(Class<T> clazz);  }