@Test public void shouldBuildEqualsWithOrderBy() { List<ConditionalCriteria> criteriaList = criteriaFor(Person.class) .withProperty(aaa()).eq(1234) .withProperty(bbb()).eq("qqq") .orderBy(ccc()).ascending() .build(); assertEquals(3, criteriaList.size()); ConditionalCriteria criteria1 = criteriaList.get(0); assertEquals("aaa", criteria1.getPropertyName()); assertEquals(ConditionalCriteria.Operator.Equal, criteria1.getOperator()); assertEquals(1234, criteria1.getFirstOperant()); assertNull(criteria1.getSecondOperant()); ConditionalCriteria criteria2 = criteriaList.get(1); assertEquals("bbb", criteria2.getPropertyName()); assertEquals(ConditionalCriteria.Operator.Equal, criteria2.getOperator()); assertEquals("qqq", criteria2.getFirstOperant()); assertNull(criteria2.getSecondOperant()); ConditionalCriteria criteria3 = criteriaList.get(2); assertEquals(ConditionalCriteria.Operator.OrderAsc, criteria3.getOperator()); assertEquals("ccc", criteria3.getPropertyName()); }
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);  }