Search in sources :

Example 26 with FreeUpdateSqlBuilder

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

the class FreeUpdateSqlBuilderTest method testSetTemplate.

@Test
public void testSetTemplate() throws SQLException {
    FreeUpdateSqlBuilder test = createTest();
    test.setTemplate(template);
    assertEquals(template, test.build());
}
Also used : FreeUpdateSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.FreeUpdateSqlBuilder) Test(org.junit.Test)

Example 27 with FreeUpdateSqlBuilder

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

the class FreeUpdateSqlBuilderTest method testSet.

@Test
public void testSet() throws SQLException {
    FreeUpdateSqlBuilder test = createTest();
    test.set(template, tableName, noShardTableName);
    assertEquals("SET [template]=?, [dal_client_test]=?, [noShard]=?", test.build());
    test = createTest();
    test.update(table(noShardTableName));
    test.set(template, tableName, noShardTableName);
    assertEquals("UPDATE " + wrappedNoShardTableName + " SET [template]=?, [dal_client_test]=?, [noShard]=?", test.build());
    test = createTest();
}
Also used : FreeUpdateSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.FreeUpdateSqlBuilder) Test(org.junit.Test)

Aggregations

FreeUpdateSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.FreeUpdateSqlBuilder)27 DalHints (com.ctrip.platform.dal.dao.DalHints)20 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)20 Test (org.junit.Test)7 FreeSelectSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder)2 GenTaskByFreeSql (com.ctrip.platform.dal.daogen.entity.GenTaskByFreeSql)1 GenTaskBySqlBuilder (com.ctrip.platform.dal.daogen.entity.GenTaskBySqlBuilder)1