@Test public void shouldBuildListOfConditions() { List<ConditionalCriteria> criteria = criteriaFor(Person.class) .withProperty(aaa()).eq(1234) .and().withProperty(bbb()).eq("zzz") .and().withProperty(ccc()).eq("xxx") .build(); ConditionalCriteria first=(ConditionalCriteria) criteria.get(0); ConditionalCriteria second=(ConditionalCriteria) criteria.get(1); ConditionalCriteria third=(ConditionalCriteria) criteria.get(2); assertEquals("aaa", first.property.getName()); assertEquals("bbb", second.property.getName()); assertEquals("ccc", third.property.getName()); }
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);  }