Search in sources :

Example 21 with DalHints

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

the class MySqlDatabaseInitializer method tearDownAfterClass.

public static void tearDownAfterClass() throws Exception {
    DalHints hints = new DalHints();
    String[] sqls = new String[] { DROP_TABLE_SQL, DROP_SP_WITHOUT_OUT_PARAM, DROP_SP_WITH_OUT_PARAM, DROP_SP_WITH_IN_OUT_PARAM, DROP_SP_WITH_INTERMEDIATE_RESULT };
    client.batchUpdate(sqls, hints);
}
Also used : DalHints(com.ctrip.platform.dal.dao.DalHints)

Example 22 with DalHints

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

the class MySqlDatabaseInitializer method setUpBeforeClass.

public static void setUpBeforeClass() throws Exception {
    DalHints hints = new DalHints();
    String[] sqls = new String[] { DROP_TABLE_SQL, CREATE_TABLE_SQL, DROP_SP_WITHOUT_OUT_PARAM, CREATE_SP_WITHOUT_OUT_PARAM, DROP_SP_WITH_OUT_PARAM, CREATE_SP_WITH_OUT_PARAM, DROP_SP_WITH_IN_OUT_PARAM, CREATE_SP_WITH_IN_OUT_PARAM, DROP_SP_WITH_INTERMEDIATE_RESULT, CREATE_SP_WITH_INTERMEDIATE_RESULT };
    client.batchUpdate(sqls, hints);
}
Also used : DalHints(com.ctrip.platform.dal.dao.DalHints)

Example 23 with DalHints

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

the class MySqlDatabaseInitializer method setUp.

public static void setUp() throws Exception {
    DalHints hints = new DalHints();
    String[] insertSqls = new String[] { "INSERT INTO " + TABLE_NAME + " VALUES(1, 10, 1, 'SH INFO', NULL)", "INSERT INTO " + TABLE_NAME + " VALUES(2, 11, 1, 'BJ INFO', NULL)", "INSERT INTO " + TABLE_NAME + " VALUES(3, 12, 2, 'SZ INFO', NULL)" };
    int[] counts = client.batchUpdate(insertSqls, hints);
    Assert.assertArrayEquals(new int[] { 1, 1, 1 }, counts);
}
Also used : DalHints(com.ctrip.platform.dal.dao.DalHints)

Example 24 with DalHints

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

the class OracleDatabaseInitializer method tearDownAfterClass.

public static void tearDownAfterClass() throws Exception {
    DalHints hints = new DalHints();
    String[] sqls = new String[] { DROP_TABLE_SEQ, DROP_TABLE_TRIG, DROP_TABLE_SQL, DROP_SP_WITHOUT_OUT_PARAM, DROP_SP_WITH_OUT_PARAM, DROP_SP_WITH_IN_OUT_PARAM, DROP_SP_WITH_INTERMEDIATE_RESULT };
    client.batchUpdate(sqls, hints);
}
Also used : DalHints(com.ctrip.platform.dal.dao.DalHints)

Example 25 with DalHints

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

the class SqlServerDatabaseInitializer method tearDown.

public static void tearDown() throws Exception {
    String sql = "DELETE FROM " + TABLE_NAME;
    StatementParameters parameters = new StatementParameters();
    DalHints hints = new DalHints();
    try {
        client.update(sql, parameters, hints);
    } catch (SQLException e) {
        e.printStackTrace();
    }
}
Also used : DalHints(com.ctrip.platform.dal.dao.DalHints) SQLException(java.sql.SQLException) StatementParameters(com.ctrip.platform.dal.dao.StatementParameters)

Aggregations

DalHints (com.ctrip.platform.dal.dao.DalHints)772 Test (org.junit.Test)532 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)317 SQLException (java.sql.SQLException)298 ArrayList (java.util.ArrayList)132 ClientTestModel (test.com.ctrip.platform.dal.dao.unitbase.ClientTestModel)61 List (java.util.List)48 KeyHolder (com.ctrip.platform.dal.dao.KeyHolder)45 FreeSelectSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder)39 Future (java.util.concurrent.Future)32 DalTableDao (com.ctrip.platform.dal.dao.DalTableDao)29 SelectionContext (com.ctrip.platform.dal.dao.configure.SelectionContext)27 DalDefaultJpaParser (com.ctrip.platform.dal.dao.helper.DalDefaultJpaParser)27 DataBase (com.ctrip.platform.dal.dao.configure.DataBase)26 BeforeClass (org.junit.BeforeClass)26 AfterClass (org.junit.AfterClass)25 HashMap (java.util.HashMap)23 FreeUpdateSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.FreeUpdateSqlBuilder)20 DalClient (com.ctrip.platform.dal.dao.DalClient)18 BatchUpdateTask (com.ctrip.platform.dal.dao.task.BatchUpdateTask)18