use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalQueryDaoSqlSvrTest method tearDown.
@After
public void tearDown() throws Exception {
String sql = "DELETE FROM " + TABLE_NAME;
StatementParameters parameters = new StatementParameters();
DalHints hints = new DalHints();
sql = "DELETE FROM " + TABLE_NAME;
parameters = new StatementParameters();
hints = new DalHints();
for (int i = 0; i < mod; i++) {
clientSqlSvr.update(sql, parameters, hints.inShard(i));
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalQueryDaoSqlSvrTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws Exception {
DalHints hints = new DalHints();
String[] sqls = null;
// For SQL server
hints = new DalHints();
StatementParameters parameters = new StatementParameters();
for (int i = 0; i < mod; i++) {
sqls = new String[] { DROP_TABLE_SQL_SQLSVR_TPL, CREATE_TABLE_SQL_SQLSVR_TPL };
for (int j = 0; j < sqls.length; j++) {
clientSqlSvr.update(sqls[j], parameters, hints.inShard(i));
}
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalQueryDaoTest method testQueryFirstAllShardsNullableAsync.
@Test
public void testQueryFirstAllShardsNullableAsync() {
try {
DalHints hints = new DalHints();
StatementParameters parameters = new StatementParameters();
ClientTestModel result = dao.queryFirstNullable(sqlNoResult, parameters(), hints.inAllShards().asyncExecution(), new ClientTestDalRowMapper());
assertNull(result);
Future<ClientTestModel> fr = (Future<ClientTestModel>) hints.getAsyncResult();
result = fr.get();
assertNull(result);
} catch (Exception e) {
e.printStackTrace();
fail();
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalQueryDaoOracleTest method tearDown.
@After
public void tearDown() throws Exception {
String sql = "DELETE FROM " + TABLE_NAME;
StatementParameters parameters = new StatementParameters();
DalHints hints = new DalHints();
try {
for (int i = 0; i < mod; i++) {
client.update(sql, parameters, hints.inShard(i));
}
} catch (SQLException e) {
e.printStackTrace();
fail();
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalQueryDaoTest method testQueryForObjectAllShardsNullable.
@Test
public void testQueryForObjectAllShardsNullable() {
try {
DalHints hints = new DalHints();
StatementParameters parameters = new StatementParameters();
ClientTestModel result = dao.queryForObjectNullable(sqlNoResult, parameters(), hints.inAllShards(), new ClientTestDalRowMapper());
assertNull(result);
} catch (Exception e) {
e.printStackTrace();
fail();
}
}
Aggregations