Package org.nutz.dao.util.cri

Examples of org.nutz.dao.util.cri.SimpleCriteria.where()


  }

  @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

    }

    @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

    }

    @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

    }

    @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
Copyright © 2018 www.massapi.com. 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.