Examples of toHandle()


Examples of com.bleujin.framework.db.Rows.toHandle()

  String query = "select * from copy_sample order by no1" ;
 
  public void testMapHandler() throws Exception {
    Rows rows = dc.getRows(query, 10, 1) ;
    Map results = (Map)rows.toHandle(new MapHandler()) ;
   

    assertEquals(2, results.size()) ;

    assertEquals("1", results.get("no1").toString()) ;
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()

 
 
  public void testMapList() throws Exception {
    Rows rows = dc.getRows(query, 10, 1) ;
   
    List<Map> results = (List<Map>)rows.toHandle(new MapListHandler()) ;
   
    assertEquals(10, results.size()) ;
    Map row = results.get(0);
   
    assertEquals("1", row.get("no1").toString()) ;
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()

 
 
  public void testBeanList() throws Exception {
    Rows rows = dc.getRows(query, 10, 1) ;
   
    List<TestBean> results = (List<TestBean>)rows.toHandle(new BeanListHandler(TestBean.class)) ;
    assertEquals(10, results.size()) ;

    TestBean row = results.get(0);
    assertEquals(1, row.getNo1()) ;
    assertEquals("01", row.getNo2()) ;
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()

 
  }
 
  public void testScalar() throws Exception {
    Rows rows = dc.getRows(query, 10, 1) ;
    Object value = rows.toHandle(new ScalarHandler()) ;
   
    assertEquals("1", value.toString()) ;
   
   
    rows = dc.getRows(query, 10, 1) ;
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()

   
    assertEquals("1", value.toString()) ;
   
   
    rows = dc.getRows(query, 10, 1) ;
    Object secondValue = rows.toHandle(new ScalarHandler(2)) ;
    assertEquals("01", secondValue) ;
  }
 
 
 
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()

      JSONObject result = new JSONObject() ;
      result.put("RESULT", body) ;
     
      if ( (rs instanceof Rows&&  (((Rows)rs).getNextRows() != null) ){
        Rows nextRows = ((Rows)rs).getNextRows() ;
        JSONObject nextObj = (JSONObject) nextRows.toHandle(new JSONHandler()) ;
        result.put("NEXT", nextObj) ;
      }
     
      return result ;
  }
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()

  }
 
  public JSONObject execute() throws SQLException{
    if (commandType == IQueryable.QUERY_COMMAND){
      Rows rows = query.execQuery() ;
      return (JSONObject) rows.toHandle(new JSONHandler());
    } else {
      int rowcount = query.execUpdate() ;
      JSONObject body = new JSONObject() ;
      body.put("ROWCOUNT", rowcount) ;
     
View Full Code Here

Examples of com.bleujin.framework.db.Rows.toHandle()


  public void testClassBean() throws Exception {
    Rows rows = dc.getRows("select * from copy_tblc", 10, 1) ;
   
    List<TestBean> list = (List<TestBean>)rows.toHandle(new BeanListHandler(TestBean.class)) ;
    for(TestBean bean : list){
      Debug.debug(bean) ;
    }
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.