Search in sources :

Example 16 with Clause

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());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 17 with Clause

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());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 18 with Clause

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());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 19 with Clause

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());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Aggregations

Clause (com.ctrip.platform.dal.dao.sqlbuilder.Clause)19 Test (org.junit.Test)19 AbstractFreeSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder)1