Package org.objectweb.speedo.pobjects.odis

Examples of org.objectweb.speedo.pobjects.odis.Trackpoint


  private void createCompetition(){
    //create the competition
    Competition competition = new Competition(competitionId++);
    //create trackpoints
    Trackpoint trackpoint1 = new Trackpoint(trackpointId++);
    Trackpoint trackpoint2 = new Trackpoint(trackpointId++);
    Trackpoint trackpoint3 = new Trackpoint(trackpointId++);
    Trackpoint trackpoint4 = new Trackpoint(trackpointId++);
   
    competition.addTrackpoint(trackpoint1);
    competition.addTrackpoint(trackpoint2);
    competition.addTrackpoint(trackpoint3);
    competition.addTrackpoint(trackpoint4);
View Full Code Here


  public void testGetTrackpoints() {
    logger.log(BasicLevel.DEBUG, "**************testGetTrackpoints***********");
    //create the competition
    Competition competition = new Competition(1);
    //create trackpoints
    Trackpoint trackpoint1 = new Trackpoint(1);
    Trackpoint trackpoint2 = new Trackpoint(2);
    Trackpoint trackpoint3 = new Trackpoint(3);
    Trackpoint trackpoint4 = new Trackpoint(4);
   
    competition.addTrackpoint(trackpoint1);
    competition.addTrackpoint(trackpoint2);
    competition.addTrackpoint(trackpoint3);
    competition.addTrackpoint(trackpoint4);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    //store the graph defined above in the datastore
    pm.currentTransaction().begin();
    //make persistent the competition
    // all the references reachable from this object will be made persistent
        pm.makePersistent(competition);
        pm.currentTransaction().commit();
       
        //get the id of competition
        Object idCompetition = pm.getObjectId(competition);
       
        Competition copyCompetition = (Competition) pm.getObjectById(idCompetition, true);
        //print the trackpoints
        Collection collection = copyCompetition.getTrackpoints();
        Iterator it = collection.iterator();
        logger.log(BasicLevel.DEBUG, "Collection length=" + collection.size());
        while(it.hasNext()){
          Trackpoint tp = (Trackpoint) it.next();
          logger.log(BasicLevel.DEBUG, "Trackpoint[id_order=" + tp.getId_order() + ",id_competition=" + tp.getId_competition() + "]");
        }
       
        //get the id of trackpoint1
        Object idTrackpoint = pm.getObjectId(trackpoint1);
        Trackpoint copyTrackpoint = (Trackpoint) pm.getObjectById(idTrackpoint, true);
        logger.log(BasicLevel.DEBUG, "competition: " + copyTrackpoint.getCompetition().getId());
       
        pm.close();       
  }
View Full Code Here

    while(itExtent.hasNext()) {
      comp =  (Competition)itExtent.next();
      logger.log(BasicLevel.DEBUG, "Competition: id=" + comp.getId() + ", tps=" + comp.getTrackpoints().toString());
      itTp = comp.getTrackpoints().iterator();
      while(itTp.hasNext()){
        Trackpoint tp = (Trackpoint) itTp.next();
        logger.log(BasicLevel.DEBUG, "Trackpoint: id_order=" + tp.getId_order() + ", id_competition=" + tp.getId_competition() );
      }
     
    }
    extent.closeAll();
   
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.odis.Trackpoint

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.