Search in sources :

Example 1 with PrintSqlHandler

use of com.github.drinkjava2.jdbpro.handler.PrintSqlHandler in project jSqlBox by drinkjava2.

the class HandlersTest method testPrintSqlHandler.

@Test
public void testPrintSqlHandler() throws SQLException {
    List<Map<String, Object>> result = ctx.nQuery(new MapListHandler(), "select u.* from DemoUser u where u.age>?", 0);
    Assert.assertTrue(result.size() == 99);
    List<Map<String, Object>> result2 = ctx.nQuery(new Wrap(new MapListHandler(), new PrintSqlHandler()), "select u.* from DemoUser u where u.age>?", 0);
    Assert.assertTrue(result2.size() == 99);
}
Also used : MapListHandler(org.apache.commons.dbutils.handlers.MapListHandler) EntitySqlMapListHandler(com.github.drinkjava2.jsqlbox.handler.EntitySqlMapListHandler) Wrap(com.github.drinkjava2.jdbpro.handler.Wrap) PrintSqlHandler(com.github.drinkjava2.jdbpro.handler.PrintSqlHandler) Map(java.util.Map) Test(org.junit.Test)

Aggregations

PrintSqlHandler (com.github.drinkjava2.jdbpro.handler.PrintSqlHandler)1 Wrap (com.github.drinkjava2.jdbpro.handler.Wrap)1 EntitySqlMapListHandler (com.github.drinkjava2.jsqlbox.handler.EntitySqlMapListHandler)1 Map (java.util.Map)1 MapListHandler (org.apache.commons.dbutils.handlers.MapListHandler)1 Test (org.junit.Test)1