use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.
the class ExpressionsTest method testAnd.
@Test
public void testAnd() throws SQLException {
Clause test = AND;
setEnv(test);
assertEquals("AND", test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.
the class ExpressionsTest method testRightBracket.
@Test
public void testRightBracket() throws SQLException {
Clause test = rightBracket;
setEnv(test);
assertEquals(")", test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.
the class ExpressionsTest method testConditionExpression.
@Test
public void testConditionExpression() throws SQLException {
Clause test = expression(true, template);
setEnv(test);
assertEquals(template, test.build());
test = expression(false, template);
setEnv(test);
assertEquals("", test.build());
test = expression(true, template, wrappedTemplate);
setEnv(test);
assertEquals(template, test.build());
test = expression(false, template, wrappedTemplate);
setEnv(test);
assertEquals(wrappedTemplate, test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.
the class ExpressionsTest method testNotIn.
@Test
public void testNotIn() throws SQLException {
Clause test = notIn(template);
setEnv(test);
assertEquals(wrappedTemplate + " NOT IN ( ? )", test.build());
}
Aggregations