Package org.openspp.dto

Examples of org.openspp.dto.RouteGroup


  }

  public ResultSetResult<RouteGroup> execute() {

    List<RouteGroup> rteGrpResultList = new ArrayList<RouteGroup>();
    RouteGroup rteGrpResult = null;
    ResultSetResult<RouteGroup> result = new ResultSetResult<RouteGroup>();

    try {
      // for now - query in a loop
      // according to spec - should also return a list
View Full Code Here


  }

  public void setDto(List<RouteGroup> dtoList) {

    for (RouteGroup rg : dtoList) {
      RouteGroup rGrp = (RouteGroup) rg;
      rteGrpList.add(rGrp);
    }

  }
View Full Code Here

  /**
   * Test method for {@link org.openspp.dao.impl.RouteGroupDAOImpl#addOrUpdateRouteGroup(org.openspp.dto.RouteGroup)}.
   */
  @Test
  public void testAddOrUpdateRouteGroup() {
    RouteGroup rg = new RouteGroup() ;
    rg.setRouteGroupName("rgtest_rg1") ;
    rg.setOrganizationName("rgtest1") ;
    rg.setInService(true) ;
    rg.setPriority((short)10) ;
   
    ArrayList<RouteRecord> routeRecordList = new ArrayList<RouteRecord>() ;
   
    //Add 2 route records, alternatively NAPTRs could also be added
    RouteRecord rr1 = new RouteRecord() ;
    rr1.setOrganizationName("rgtest1") ;
    rr1.setRouteRecordName("rgtest_rr1") ;
    rr1.setPriority(Short.valueOf("5")) ;
    routeRecordList.add(rr1) ;

    RouteRecord rr2 = new RouteRecord() ;
    rr2.setOrganizationName("rgtest1") ;
    rr2.setRouteRecordName("rgtest_rr2") ;
    rr2.setPriority(Short.valueOf("6")) ;
    routeRecordList.add(rr2) ;

    // set RouteRecords
    rg.setRouteRecordList(routeRecordList) ;
   
    // Add one or more Destination Group Names
   
    ArrayList<String> destGrpList = new ArrayList<String>() ;
    destGrpList.add("rgtest_dg1") ;
    rg.setDestGrpNameList(destGrpList) ;
 
   
   
    dao.addOrUpdateRouteGroup(rg) ;
    System.out.println("testAddOrUpdateRouteGroup->"+rg);
    rg.setPriority((short)20) ;
    dao.addOrUpdateRouteGroup(rg) ;
  }
View Full Code Here

  @Test
  public void testGetRouteGroup() {
    ObjectKey key = new ObjectKey() ;
    key.setObjectName("rgtest_rg1") ;
    key.setRegistrantName("rgtest1") ;
    RouteGroup rg = dao.getRouteGroup(key) ;
    System.out.println("testGetRouteGroup->"+rg);
  }
View Full Code Here

  /**
   * Test method for {@link org.openspp.dao.impl.RouteGroupDAOImpl#addOrUpdateRouteGroup(org.openspp.dto.RouteGroup)}.
   */
  @Test
  public void testAddOrUpdateRouteGroup() {
    RouteGroup rg = new RouteGroup() ;
    rg.setRouteGroupName("rg1") ;
    rg.setOrganizationName("rant1") ;
    rg.setInService(true) ;
    rg.setPriority((short)10) ;
   
    ArrayList<RouteRecord> routeRecordList = new ArrayList<RouteRecord>() ;
   
    //Add 2 route records, alternatively NAPTRs could also be added
    RouteRecord rr1 = new RouteRecord() ;
    rr1.setOrganizationName("rant1") ;
    rr1.setRouteRecordName("rr1") ;
    rr1.setPriority(Short.valueOf("5")) ;
    routeRecordList.add(rr1) ;

    RouteRecord rr2 = new RouteRecord() ;
    rr2.setOrganizationName("rant1") ;
    rr2.setRouteRecordName("rr2") ;
    rr2.setPriority(Short.valueOf("6")) ;
    routeRecordList.add(rr2) ;

    // set RouteRecords
    rg.setRouteRecordList(routeRecordList) ;
   
    // Add one or more Destination Group Names
   
    ArrayList<String> destGrpList = new ArrayList<String>() ;
    destGrpList.add("dg2") ;
   
    rg.setDestGrpNameList(destGrpList) ;
 
   
   
    dao.addOrUpdateRouteGroup(rg) ;
    System.out.println("testAddOrUpdateRouteGroup->"+rg);
    rg.setPriority((short)20) ;
    dao.addOrUpdateRouteGroup(rg) ;
  }
View Full Code Here

    // Get RouteGroupID for the newly added/updated group
    ObjectKey key = new ObjectKey() ;
    key.setObjectName(rg.getRouteGroupName()) ;
    key.setRegistrantName(rg.getOrganizationName()) ;
   
    RouteGroup rg1 = getRouteGroup(key) ;
   
    rg.setRouteGroupId(rg1.getRouteGroupId()) ;
   
    if (rg.getRouteRecordList() !=null)
    {
      // Loop thru and insert/update row in RouteGroup_RouteRecord table
      RouteRecordDAO dao = (RouteRecordDAO)SpringAppContext.getBean("RouteRecordDAO") ;
View Full Code Here

  @Test
  public void testGetRouteGroup() {
    ObjectKey key = new ObjectKey() ;
    key.setObjectName("rg1") ;
    key.setRegistrantName("rant1") ;
    RouteGroup rg = dao.getRouteGroup(key) ;
    System.out.println("testGetRouteGroup->"+rg);
  }
View Full Code Here

   */
  @Override
  public RouteGroup getRouteGroup(ObjectKey key) {
    key.setRegistrantId(getOrganizationId(key.getRegistrantName())) ;
    //TODO select from other related tables.
    RouteGroup rteGrp = jdbcTemplate.queryForObject(
          SELECT_SQL,
          new Object[]{key.getObjectName(), key.getRegistrantId()},
          new RowMapper<RouteGroup>() {
              public RouteGroup mapRow(ResultSet rs, int rowNum) throws SQLException {
                RouteGroup rg = new RouteGroup();
                rg.setRouteGroupId(rs.getInt(1)) ;
                rg.setRouteGroupName(rs.getString(2)) ;
                rg.setOrganizationId(rs.getInt(3)) ;
                rg.setInService(rs.getBoolean(4)) ;
                rg.setPriority(rs.getShort(5)) ;
                rg.setCreatedDateTime(rs.getDate(6)) ;
                rg.setModifiedDateTime(rs.getDate(7)) ;
                  return rg;
              }
          });
   
    //List of RouteRecords if any
View Full Code Here

    // Get RouteGroupID for the newly added/updated group
    ObjectKey key = new ObjectKey() ;
    key.setObjectName(rg.getRouteGroupName()) ;
    key.setRegistrantName(rg.getOrganizationName()) ;
   
    RouteGroup rg1 = getRouteGroup(key) ;
   
    rg.setRouteGroupId(rg1.getRouteGroupId()) ;
   
    if (rg.getRouteRecordList() !=null)
    {
      // Loop thru and insert/update row in RouteGroup_RouteRecord table
      RouteRecordDAO dao = (RouteRecordDAO)SpringAppContext.getBean("RouteRecordDAO") ;
View Full Code Here

   */
  @Override
  public RouteGroup getRouteGroup(ObjectKey key) {
    key.setRegistrantId(getOrganizationId(key.getRegistrantName())) ;
    //TODO select from other related tables.
    RouteGroup rteGrp ;
    try
    {
       rteGrp = jdbcTemplate.queryForObject(
          SELECT_SQL,
          new Object[]{key.getObjectName(), key.getRegistrantId()},
          new RowMapper<RouteGroup>() {
              public RouteGroup mapRow(ResultSet rs, int rowNum) throws SQLException {
                RouteGroup rg = new RouteGroup();
                rg.setRouteGroupId(rs.getInt(1)) ;
                rg.setRouteGroupName(rs.getString(2)) ;
                rg.setOrganizationId(rs.getInt(3)) ;
                rg.setInService(rs.getBoolean(4)) ;
                rg.setPriority(rs.getShort(5)) ;
                rg.setCreatedDateTime(rs.getDate(6)) ;
                rg.setModifiedDateTime(rs.getDate(7)) ;
                  return rg;
              }
          });
    }catch(EmptyResultDataAccessException e)
    {
View Full Code Here

TOP

Related Classes of org.openspp.dto.RouteGroup

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.