Package com.google.appengine.datanucleus.test.jdo

Examples of com.google.appengine.datanucleus.test.jdo.TimestampVersionJDO


*/
public class JDOVersionTest extends JDOTestCase {

  public void testTimestampVersion() {
    pm.currentTransaction().begin();
    TimestampVersionJDO tv = new TimestampVersionJDO();
    tv.setStr1("First Value");
    pm.makePersistent(tv);
    pm.currentTransaction().commit();
    Object firstVersion = JDOHelper.getVersion(tv);
    Assert.assertTrue(firstVersion instanceof Timestamp);

    pm.currentTransaction().begin();
    tv.setStr1("Second Value");
    pm.currentTransaction().commit();
    Object secondVersion = JDOHelper.getVersion(tv);
    Assert.assertTrue(secondVersion instanceof Timestamp);
    long firstMillis = ((Timestamp)firstVersion).getTime();
    long secondMillis = ((Timestamp)secondVersion).getTime();
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.TimestampVersionJDO

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.