use of org.nutz.dao.Condition in project nutz by nutzam.
the class CndTest method test_is_not_null.
@Test
public void test_is_not_null() {
Condition c = Cnd.where("nm", " is nOT ", null);
String exp = "WHERE nm IS NOT NULL";
assertEquals(exp, c.toSql(null).trim());
}
use of org.nutz.dao.Condition in project nutz by nutzam.
the class CndTest method test_not_sql_group.
@Test
public void test_not_sql_group() {
SqlExpression e2 = Cnd.exps("f2", "=", 1);
SqlExpression e3 = Cnd.exps("f3", "=", 1);
Condition c = Cnd.where(e2).andNot(e3);
assertEquals(" WHERE (f2=1) AND NOT (f3=1)", c.toString());
}
use of org.nutz.dao.Condition in project nutz by nutzam.
the class CndTest method test_in_by_int_array.
@Test
public void test_in_by_int_array() {
int[] ids = { 3, 5, 7 };
Condition c = Cnd.where("id", "iN", ids);
String exp = "WHERE id IN (3,5,7)";
assertEquals(exp, c.toSql(null).trim());
}
use of org.nutz.dao.Condition in project nutz by nutzam.
the class CndTest method test_is_null.
@Test
public void test_is_null() {
Condition c = Cnd.where("nm", " is ", null);
String exp = "WHERE nm IS NULL";
assertEquals(exp, c.toSql(null).trim());
}
use of org.nutz.dao.Condition in project nutz by nutzam.
the class CndTest method test_not_in.
@Test
public void test_not_in() {
Condition c = Cnd.where("nm", " Not iN ", new int[] { 1, 2, 3 });
String exp = "WHERE nm NOT IN (1,2,3)";
assertEquals(exp, c.toSql(null).trim());
}