use of test.com.ctrip.platform.dal.dao.unitbase.ClientTestModel in project dal by ctripcorp.
the class DalDirectClientTestStub method quryTestWithParameters.
/**
* Test the basic query function without parameters
*
* @throws SQLException
*/
@Test
public void quryTestWithParameters() throws SQLException {
String querySql = "SELECT * FROM " + TABLE_NAME + " WHERE type = ?";
StatementParameters parameters = new StatementParameters();
parameters.set(1, Types.SMALLINT, 1);
ClientTestDalRowMapper mapper = new ClientTestDalRowMapper();
DalHints hints = new DalHints();
List<ClientTestModel> res = client.query(querySql, parameters, hints, new DalRowMapperExtractor<ClientTestModel>(mapper));
Assert.assertTrue(null != res);
Assert.assertEquals(2, res.size());
}
Aggregations