コード例 #1
0
  @Test
  public void Various() {
    StringPath str = user.lastName;
    List<Predicate> predicates = new ArrayList<Predicate>();
    predicates.add(str.between("a", "b"));
    predicates.add(str.contains("a"));
    predicates.add(str.containsIgnoreCase("a"));
    predicates.add(str.endsWith("a"));
    predicates.add(str.endsWithIgnoreCase("a"));
    predicates.add(str.eq("a"));
    predicates.add(str.equalsIgnoreCase("a"));
    predicates.add(str.goe("a"));
    predicates.add(str.gt("a"));
    predicates.add(str.in("a", "b", "c"));
    predicates.add(str.isEmpty());
    predicates.add(str.isNotNull());
    predicates.add(str.isNull());
    //        predicates.add(str.like("a"));
    predicates.add(str.loe("a"));
    predicates.add(str.lt("a"));
    predicates.add(str.matches("a"));
    predicates.add(str.ne("a"));
    predicates.add(str.notBetween("a", "b"));
    predicates.add(str.notIn("a", "b", "c"));
    predicates.add(str.startsWith("a"));
    predicates.add(str.startsWithIgnoreCase("a"));

    for (Predicate predicate : predicates) {
      where(predicate).count();
      where(predicate.not()).count();
    }
  }
コード例 #2
0
 @Test
 public void Between_Empty_Strings() throws Exception {
   testQuery(title.between("", ""), "title:[ TO ]", 0);
 }
コード例 #3
0
 @Test
 public void Between_Does_Not_Find_Results() throws Exception {
   testQuery(title.between("Indiana", "Jurassib"), "title:[indiana TO jurassib]", 0);
 }
コード例 #4
0
 @Test
 public void Between_Is_Inclusive_To_End() throws Exception {
   testQuery(title.between("Indiana", "Jurassic"), "title:[indiana TO jurassic]", 1);
 }
コード例 #5
0
 @Test
 public void Between_Is_Inclusive_From_Start() throws Exception {
   testQuery(title.between("Jurassic", "Kundun"), "title:[jurassic TO kundun]", 1);
 }
コード例 #6
0
 @Test
 public void Between() throws Exception {
   testQuery(title.between("Indiana", "Kundun"), "title:[indiana TO kundun]", 1);
 }