Package javax.jdo.datastore

Examples of javax.jdo.datastore.Sequence.current()


    PersistenceManager pm = pmf.getPersistenceManager();
    pm.getObjectIdClass(Cow.class);
    //get the sequence
    Sequence s = pm.getSequence(COW_SEQ);
    assertNotNull("Sequence " + COW_SEQ + " should not be null.", s);
    long beforeAllocate = ((Long) s.current()).longValue();
    Collection col = new ArrayList();
    Cow cow = null;
    for (int i = 1; i <= ADDITIONAL; i++) {
      cow = new Cow("cowAllocate" + i, ((Long)s.next()).longValue());
      col.add(cow);
View Full Code Here


    Cow cow = null;
    for (int i = 1; i <= ADDITIONAL; i++) {
      cow = new Cow("cowAllocate" + i, ((Long)s.next()).longValue());
      col.add(cow);
    }
    assertEquals(beforeAllocate + ADDITIONAL, ((Long) s.current()).longValue());
    cow = new Cow("cowAfterAllocate", ((Long)s.next()).longValue());
    col.add(cow);
    pm.currentTransaction().begin();
    //make persistent
    pm.makePersistentAll(col);
View Full Code Here

    cow = new Cow("cowAfterAllocate", ((Long)s.next()).longValue());
    col.add(cow);
    pm.currentTransaction().begin();
    //make persistent
    pm.makePersistentAll(col);
    s.current();
    pm.currentTransaction().commit();
    Iterator it = col.iterator();
    while (it.hasNext()) {
      Cow c = (Cow) it.next();
      logger.log(BasicLevel.DEBUG, "cow " + c.getName() + ": " + c.getNbOfLegs());
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.