Package org.conserve

Examples of org.conserve.PersistenceManager.saveObject()


   */
  @Test
  public void testGetClasses() throws Exception
  {
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    persist.saveObject(new SimpleObject());
    List<Class<?>> classList = persist.getClasses();
    for (Class<?> c : classList)
    {
      System.out.println(ObjectTools.getSystemicName(c));
    }
View Full Code Here


  @Test
  public void testJavaDate() throws Exception
  {
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    Date date = new Date();
    persist.saveObject(date);

    persist.close();

    persist = new PersistenceManager(driver, database, login, password);
    List<Date> dates = persist.getObjects(Date.class, new LessOrEqual(new Date()));
View Full Code Here

    OriginalObject oo = new OriginalObject();
    oo.setName(name);
    oo.setValue(value);
    oo.setOtherObject(otherObject);
    oo.setRedundantObject(redundantObject);
    pm.saveObject(oo);
    pm.close();

    // change string to long
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, StringToLong.class);
View Full Code Here

    assertEquals(1,res1.size());
    StringToLong obj1 = res1.get(0);
    assertNull(obj1.getName());
    //save a long
    obj1.setName(1);
    pm.saveObject(obj1);
    pm.close();

    // change long to string
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(StringToLong.class, OriginalObject.class);
View Full Code Here

    oo.setName(name);
    oo.setValue(value);
    oo.setOtherObject(otherObject);
    oo.setRedundantObject(redundantObject);
    oo.setArray(new long[]{8,9,10,11});
    pm.saveObject(oo);
    pm.close();

    // change array to long
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(OriginalObject.class, ArrayToLong.class);
View Full Code Here

    assertEquals(1,res1.size());
    ArrayToLong obj1 = res1.get(0);
    assertEquals(0,obj1.getArray());
    //save a long
    obj1.setArray(1);
    pm.saveObject(obj1);
    pm.close();

    //change long to array
    pm = new PersistenceManager(driver, database, login, password);
    pm.changeName(ArrayToLong.class, OriginalObject.class);
View Full Code Here

    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);
    // create two OriginalObject, store them.
    pm.saveObject(new OriginalObject());
    pm.saveObject(new OriginalObject());
    // create two NotSubClass, store them
    NotSubClass ns = new NotSubClass();
    ns.setName("foo");
    pm.saveObject(ns);
View Full Code Here

    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);
    // create two OriginalObject, store them.
    pm.saveObject(new OriginalObject());
    pm.saveObject(new OriginalObject());
    // create two NotSubClass, store them
    NotSubClass ns = new NotSubClass();
    ns.setName("foo");
    pm.saveObject(ns);
    ns = new NotSubClass();
View Full Code Here

    pm.saveObject(new OriginalObject());
    pm.saveObject(new OriginalObject());
    // create two NotSubClass, store them
    NotSubClass ns = new NotSubClass();
    ns.setName("foo");
    pm.saveObject(ns);
    ns = new NotSubClass();
    ns.setName("bar");
    pm.saveObject(ns);

    pm.close();
View Full Code Here

    NotSubClass ns = new NotSubClass();
    ns.setName("foo");
    pm.saveObject(ns);
    ns = new NotSubClass();
    ns.setName("bar");
    pm.saveObject(ns);

    pm.close();
    pm = new PersistenceManager(driver, database, login, password);
    // rename NotSubClass to SubClass
    pm.changeName(NotSubClass.class, SubClass.class);
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.