Search in sources :

Example 11 with Clause

use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.

the class AbstractFreeSqlBuilderTest method testExpression.

@Test
public void testExpression() throws SQLException {
    Clause test = expression(template);
    AbstractFreeSqlBuilder builder = create();
    builder.append(test);
    builder.setLogicDbName(logicDbName);
    assertEquals(template, test.build());
}
Also used : AbstractFreeSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder) Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 12 with Clause

use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.

the class ExpressionsTest method testBracket.

@Test
public void testBracket() throws SQLException {
    Clause test = bracket(expression(template));
    setEnv(test);
    assertEquals("(" + template + ")", test.build());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 13 with Clause

use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.

the class ExpressionsTest method testLeftBracket.

@Test
public void testLeftBracket() throws SQLException {
    Clause test = leftBracket;
    setEnv(test);
    assertEquals("(", test.build());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 14 with Clause

use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.

the class ExpressionsTest method testIn.

@Test
public void testIn() throws SQLException {
    Clause test = in(template);
    setEnv(test);
    assertEquals(wrappedTemplate + " IN ( ? )", test.build());
}
Also used : Clause(com.ctrip.platform.dal.dao.sqlbuilder.Clause) Test(org.junit.Test)

Example 15 with Clause

use of com.ctrip.platform.dal.dao.sqlbuilder.Clause in project dal by ctripcorp.

the class ExpressionsTest method testNotlike.

@Test
public void testNotlike() throws SQLException {
    Clause test = notLike(template);
    setEnv(test);
    assertEquals(wrappedTemplate + " NOT LIKE ?", 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