Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.PointMarker


    return isChanged;
  }
 
  public static PointMarker createPointMarkerObject(ResultSet rs) throws ParseException, SQLException{
    if(rs == null) return null;
    PointMarker pm = new PointMarker();
    pm.setId(rs.getInt(PointMarkerSchema.ID));
    pm.setNotes(rs.getString(PointMarkerSchema.NOTES));
    pm.setMarkerIconId(rs.getInt(PointMarkerSchema.ICON_ID));
   
    byte[] buf = rs.getBytes(PointMarkerSchema.GEOM_WKB);
    Point pt = (Point)wkbReader.read(buf);   
    pm.setPoint(pt);       
    return pm;
  }
View Full Code Here


      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findPointMarkers(?);");
      stmt.setInt(1, bm.getId());
      ResultSet rs = stmt.executeQuery();
      while (rs.next()) {
        PointMarker pm = createPointMarkerObject(rs);
        pmarks.add(pm);
      }
    } catch (Exception e) {
      logger.fatal("getPointMarkers error",e);
    } finally {
View Full Code Here

    super.tearDown();
  }
 
  public void testFromJSON2Bean() throws Exception{
    String json = "{'id':13,'notes':'foobar foo','point':'10,-20.00','iconId':5}";
    PointMarker pm = (PointMarker)converter.convertFromString(null,new String[]{json},PointMarker.class);
    assertEquals(13,pm.getId());
    assertEquals("foobar foo", pm.getNotes());
    assertEquals(-20.00,pm.getPoint().getY());
    assertEquals(10.0,pm.getPoint().getX());
    assertEquals(5,pm.getMarkerIconId());
  }
View Full Code Here

    assertEquals(10.0,pm.getPoint().getX());
    assertEquals(5,pm.getMarkerIconId());
  }
 
  public void testFromBean2JSON() throws Exception{
    PointMarker pm = new PointMarker();
    pm.setId(33);
    pm.setMarkerIconId(2);
    pm.setNotes("abc");
    pm.setPoint(33.00, -55.00);
    String s = (String)converter.convertToString(null, pm);
    assertNotNull(s);
  }
View Full Code Here

TOP

Related Classes of com.gnizr.db.dao.PointMarker

Copyright © 2018 www.massapicom. 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.