use of org.nutz.dao.sql.Criteria in project nutz by nutzam.
the class CndTest method test_in_by_criteria_string_list.
/**
* Criteria 接口测试List<String>
*/
@Test
public void test_in_by_criteria_string_list() {
List<String> ids = new ArrayList<String>();
ids.add("bj");
ids.add("sh");
ids.add("gz");
ids.add("sz");
Criteria cri = Cnd.cri();
cri.where().andInStrList("nm", ids);
assertEquals(" WHERE nm IN ('bj','sh','gz','sz')", cri.toString());
}
use of org.nutz.dao.sql.Criteria in project nutz by nutzam.
the class CndTest method test_not_in_by_criteria_int_list.
/**
* Criteria 接口测试List<Integer>
*/
@Test
public void test_not_in_by_criteria_int_list() {
List<Integer> ids = new ArrayList<Integer>();
ids.add(1);
ids.add(2);
ids.add(3);
Criteria cri = Cnd.cri();
cri.where().andNotInIntList("nm", ids);
assertEquals(" WHERE nm NOT IN (1,2,3)", cri.toString());
}
use of org.nutz.dao.sql.Criteria in project nutz by nutzam.
the class CndTest method test_not_in_by_criteria_int_array.
/**
* Criteria 接口测试int[]数组
*/
@Test
public void test_not_in_by_criteria_int_array() {
int[] ids = { 1, 2, 3 };
Criteria cri = Cnd.cri();
cri.where().andNotInArray("nm", ids);
assertEquals(" WHERE nm NOT IN (1,2,3)", cri.toString());
}
use of org.nutz.dao.sql.Criteria in project nutz by nutzam.
the class CndTest method test_in_by_criteria_int_list.
/**
* Criteria 接口测试List<Integer>
*/
@Test
public void test_in_by_criteria_int_list() {
List<Integer> ids = new ArrayList<Integer>();
ids.add(1);
ids.add(2);
ids.add(3);
Criteria cri = Cnd.cri();
cri.where().andInIntList("nm", ids);
assertEquals(" WHERE nm IN (1,2,3)", cri.toString());
}
Aggregations