Package org.objectweb.speedo.pobjects.sequence.id

Examples of org.objectweb.speedo.pobjects.sequence.id.Phone


    PersistenceManager pm = pmf.getPersistenceManager();
    pm.getObjectIdClass(Phone.class);
    //get the sequence
    Sequence s = pm.getSequence(PHONE_SEQ);
    assertNotNull("Sequence " + PHONE_SEQ + " should not be null.", s);
    Phone p1 = new Phone();
    p1.setName("phone 1");
    Phone p2 = new Phone();
    p2.setName("phone 2");
    //make persistent
    pm.currentTransaction().begin();
    pm.makePersistent(p1);
    pm.makePersistent(p2);
    pm.currentTransaction().commit();
View Full Code Here


      long timeAllocate = System.currentTimeMillis();
      pm.currentTransaction().begin();
      //allocate
      s.allocate(ADDITIONAL);
      for (int i = 0; i < ADDITIONAL ; i++) {
        phones[i] = new Phone();
        phones[i].setName("phone " + i);
      }
      //make persistent
      pm.makePersistentAll(phones);
      pm.currentTransaction().commit();
      timeAllocate = System.currentTimeMillis() - timeAllocate;
      long timeNext = System.currentTimeMillis();
      pm.currentTransaction().begin();
      for (int i = ADDITIONAL; i < ADDITIONAL*2 ; i++) {
        phones[i - ADDITIONAL] = new Phone();
        phones[i - ADDITIONAL].setName("phone " + i);
      }
      //make persistent
      pm.makePersistentAll(phones);
      pm.currentTransaction().commit();
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.sequence.id.Phone

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.