Package org.nutz.dao.util.cri

Examples of org.nutz.dao.util.cri.SimpleCriteria


  public static Cnd where(SqlExpression e) {
    return new Cnd(e);
  }

  public static SimpleCriteria cri() {
    return new SimpleCriteria();
  }
View Full Code Here


  /*------------------------------------------------------------------*/

  private SimpleCriteria cri;

  Cnd() {
    cri = new SimpleCriteria();
  }
View Full Code Here

    assertEquals("pet6", pets.get(0).getName());
  }

  @Test
  public void query_by_like_ignorecase() {
    SimpleCriteria cri = Cnd.cri();
    cri.where().andLike("name", "PeT6", true);
    List<Pet> pets = dao.query(Pet.class, cri, dao.createPager(1, 10));
    assertEquals(1, pets.size());
    assertEquals("pet6", pets.get(0).getName());
  }
View Full Code Here

    }

  }

  public Condition createCondition(Object host) {
    SimpleCriteria cri = Cnd.cri();
    cri.where().andInBySqllinkedField.getColumnName(),
                "SELECT %s FROM %s WHERE %s=%s",
                toColumnName,
                this.getRelationName(),
                fromColumnName,
                Sqls.formatFieldValue(hostField.getValue(host)));
View Full Code Here

    public static Cnd where(SqlExpression e) {
        return new Cnd(e);
    }

    public static SimpleCriteria cri() {
        return new SimpleCriteria();
    }
View Full Code Here

    /*------------------------------------------------------------------*/

    private SimpleCriteria cri;

    Cnd() {
        cri = new SimpleCriteria();
    }
View Full Code Here

        assertEquals("pet6", pets.get(0).getName());
    }

    @Test
    public void query_by_like_ignorecase() {
        SimpleCriteria cri = Cnd.cri();
        cri.where().andLike("name", "PeT6", true);
        List<Pet> pets = dao.query(Pet.class, cri, dao.createPager(1, 10));
        assertEquals(1, pets.size());
        assertEquals("pet6", pets.get(0).getName());
    }
View Full Code Here

        }

    }

    public Condition createCondition(Object host) {
        SimpleCriteria cri = Cnd.cri();
        cri.where().andInBySql(    linkedField.getColumnName(),
                                "SELECT %s FROM %s WHERE %s=%s",
                                toColumnName,
                                this.getRelationName(),
                                fromColumnName,
                                Sqls.formatFieldValue(hostField.getValue(host)));
View Full Code Here

        assertEquals("pet6", pets.get(0).getName());
    }

    @Test
    public void query_by_like_ignorecase() {
        SimpleCriteria cri = Cnd.cri();
        cri.where().andLike("name", "PeT6", true);
        List<Pet> pets = dao.query(Pet.class, cri, dao.createPager(1, 10));
        assertEquals(1, pets.size());
        assertEquals("pet6", pets.get(0).getName());
    }
View Full Code Here

        assertEquals("pet6", pets.get(0).getName());
    }

    @Test
    public void each_by_like_ignorecase() {
        SimpleCriteria cri = Cnd.cri();
        cri.where().andLike("name", "PeT6", true);
        final List<Pet> pets = new ArrayList<Pet>();
        dao.each(Pet.class, cri, dao.createPager(1, 10), new Each<Pet>() {
            public void invoke(int i, Pet pet, int length) {
                pets.add(pet);
            }
View Full Code Here

TOP

Related Classes of org.nutz.dao.util.cri.SimpleCriteria

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.