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

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


    PersistenceManager pm = pmf.getPersistenceManager();
    pm.getObjectIdClass(Product.class);
    //get the sequence
    Sequence s = pm.getSequence(PRODUCT_SEQ);
    assertNotNull("Sequence " + PRODUCT_SEQ + " should not be null.", s);
    Product p1 = new Product();
    p1.setName("product 1");
    Product p2 = new Product();
    p2.setName("product 2");
    //make persistent
    pm.currentTransaction().begin();
    pm.makePersistent(p1);
    pm.makePersistent(p2);
    pm.currentTransaction().commit();
    assertTrue(p1.getReference() < p2.getReference());
        pm.close();
  }
View Full Code Here

TOP

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

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.