Package org.conserve

Examples of org.conserve.PersistenceManager.saveObject()


    SimpleObject so = new SimpleObject();
    so.setAge(1000L);
    so.setCount(3);
    so.setName("foo bar");
    so.setScale(0.67);
    persist.saveObject(so);
    LessSimpleObject lso = new LessSimpleObject();
    lso.setAge(1000000L);
    lso.setCount(123456);
    lso.setKey((short) 99);
    lso.setName("j random");
View Full Code Here


    lso.setAge(1000000L);
    lso.setCount(123456);
    lso.setKey((short) 99);
    lso.setName("j random");
    lso.setScale(-9.0);
    persist.saveObject(lso);
    // insert the same object again
    persist.saveObject(lso);
    persist.close();

    persist = new PersistenceManager(driver, database, login, password);
View Full Code Here

    lso.setKey((short) 99);
    lso.setName("j random");
    lso.setScale(-9.0);
    persist.saveObject(lso);
    // insert the same object again
    persist.saveObject(lso);
    persist.close();

    persist = new PersistenceManager(driver, database, login, password);
    // try deleting one object
    List<Object> allObjects = persist.getObjectsMatching(new Object());
View Full Code Here

    so.setScale(0.67);
    co.setObject(so);
    SimplestObject sto = new SimplestObject();
    sto.setFoo(9999.6);
    co.setSimplestObject(sto);
    persist.saveObject(co);
    ComplexObject co2 = new ComplexObject(co.getData());
    co2.setObject(so);
    co2.setSimplestObject(sto);
    persist.saveObject(co2);
    persist.close();
View Full Code Here

    co.setSimplestObject(sto);
    persist.saveObject(co);
    ComplexObject co2 = new ComplexObject(co.getData());
    co2.setObject(so);
    co2.setSimplestObject(sto);
    persist.saveObject(co2);
    persist.close();
    persist = new PersistenceManager(driver, database, login, password);
    // List<Object> allList = persist.getObjects(new Object());
    // assertEquals(4, allList.size());
    List<ComplexObject> complexList = persist.getObjectsMatching(new ComplexObject());
View Full Code Here

  {
    // create the database connection
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);

    ComplexObject co1 = new ComplexObject(new double[] { 1.1, 2.2, 3.3, 4.4 });
    persist.saveObject(co1);

    // create an array of complex objects
    ComplexArrayObject cao = new ComplexArrayObject();
    ComplexObject[] coArray = new ComplexObject[3];
    for (int x = 0; x < coArray.length; x++)
View Full Code Here

      so.setAge((long) x);
      co.setObject(so);
      coArray[x] = co;
    }
    cao.setData(coArray);
    persist.saveObject(cao);
    persist.close();
    persist = new PersistenceManager(driver, database, login, password);
    List<ComplexArrayObject> res = persist.getObjectsMatching(new ComplexArrayObject());
    assertEquals(1, res.size());
    ComplexArrayObject ob1 = res.get(0);
View Full Code Here

    // create the database connection
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);

    ComplexObject co1 = new ComplexObject(new double[] { 1.1, 2.2, 3.3, 4.4 });
    // saving the object gives it an outside reference
    persist.saveObject(co1);

    // create an array of complex objects
    ComplexObject[] coArray = new ComplexObject[3];
    for (int x = 0; x < coArray.length - 1; x++)
    {
View Full Code Here

    // one of the complex objects in the array has an outside reference
    coArray[2] = co1;

    ComplexArrayObject cao = new ComplexArrayObject();
    cao.setData(coArray);
    persist.saveObject(cao);
    persist.close();

    // check that there is one ComplexArrayObject
    persist = new PersistenceManager(driver, database, login, password);
    List<ComplexArrayObject> res = persist.getObjectsMatching(new ComplexArrayObject());
View Full Code Here

      {
        array[x][y][0] = new SimplestObject();
      }
    }
    co.setObject(array);
    persist.saveObject(co);
    ComplexObject co2 = new ComplexObject();
    SimplestObject[][][] array2 = new SimplestObject[1][][];
    array2[0] = array[0];
    co2.setObject(array2);
    persist.saveObject(co2);
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.