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);
Cow c1 = new Cow("cowSeq1", ((Long)s.next()).longValue());
Cow c2 = new Cow("cowSeq2", ((Long)s.next()).longValue());
Cow c3 = new Cow("cowSeq3", ((Long)s.next()).longValue());
assertTrue(c1.getNbOfLegs() < c2.getNbOfLegs());
assertTrue(c2.getNbOfLegs() < c3.getNbOfLegs());
Collection c = new ArrayList();
c.add(c1);
c.add(c2);
c.add(c3);
//make persistent
pm.currentTransaction().begin();
pm.makePersistentAll(c);
pm.currentTransaction().commit();
logger.log(BasicLevel.DEBUG, "c1: " + c1.getNbOfLegs());
logger.log(BasicLevel.DEBUG, "c2: " + c2.getNbOfLegs());
logger.log(BasicLevel.DEBUG, "c3: " + c3.getNbOfLegs());
pm.close();
}