Package org.objectweb.speedo.pobjects.basic

Examples of org.objectweb.speedo.pobjects.basic.SqlClasses


  protected String getLoggerName() {
    return LOG_NAME + ".rt.basic.TestSqlClasses";
  }

  public void test1() {
        SqlClasses sql = new SqlClasses(1);
        java.sql.Date d = new java.sql.Date(12345);
        java.sql.Time t = new java.sql.Time(123450);
        java.sql.Timestamp ts = new java.sql.Timestamp(1234500);
        sql.setDate(d);
        sql.setTime(t);
        sql.setTimestamp(ts);
        PersistenceManager pm = pmf.getPersistenceManager();
        pm.makePersistent(sql);
        Object sId = pm.getObjectId(sql);
        Assert.assertNotNull("null object identifier", sId);
        pm.close();
        sql = null;
        pm = pmf.getPersistenceManager();
        sql = (SqlClasses) pm.getObjectById(sId, true);
        Assert.assertNotNull("null instance returned by getObjectById", sql);
        Assert.assertEquals("Bad date value", d, sql.getDate());
        Assert.assertEquals("Bad time value", t, sql.getTime());
        Assert.assertEquals("Bad timestamp value", ts, sql.getTimestamp());
        pm.currentTransaction().begin();
        pm.deletePersistent(sql);
        pm.currentTransaction().commit();
        pm.close();
    }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.basic.SqlClasses

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.