Package org.conserve.objects

Examples of org.conserve.objects.SimplestObject


    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    ConnectionWrapper cw = persist.getConnectionWrapper();
    // add a large number of entries
    for (int x = 1; x <= 100; x++)
    {
      SimplestObject so = new SimplestObject();
      so.setFoo((double) x);
      persist.saveObject(cw, so);
    }
    cw.commitAndDiscard();
    persist.close();
    persist = new PersistenceManager(driver, database, login, password);
    // construct a query that returns the objects with where foo is 3,66 and
    // 99
    SimplestObject different = new SimplestObject(100.0);
    SimplestObject larger = new SimplestObject(98.0);
    SimplestObject equal = new SimplestObject(66.0);
    SimplestObject smallerOrEquals = new SimplestObject(3.0);
    SimplestObject largerOrEquals = new SimplestObject(3.0);

    And one = new And(new GreaterOrEqual(largerOrEquals), new LessOrEqual(smallerOrEquals));
    And two = new And(new Different(different), new Greater(larger));
    List<SimplestObject> list = persist.getObjects(SimplestObject.class, new Or(one, two, new Equal(equal)));
    assertEquals(3, list.size());
View Full Code Here


    persistOne.dropTable(Object.class);
    persistTwo.dropTable(Object.class);
    // create some objects in the first database
    ComplexObject co = new ComplexObject();
    co.setData(new double[] { 1, 2, 3 });
    co.setSimplestObject(new SimplestObject(5.0));
    persistOne.saveObject(co);
    LessSimpleObject lso = new LessSimpleObject();
    lso.setAge(50L);
    lso.setName("name");
    lso.setValue(6);
View Full Code Here

  public void testRenameTable() throws Exception
  {
    String name = "foo";
    int value = 42;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create and store a new value
View Full Code Here

  public void testRenameColumn() throws Exception
  {
    String name = "foo";
    int value = 42;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create and store a new value
View Full Code Here

  public void testAddRemoveColumns() throws Exception
  {
    String name = "foo";
    int value = 42;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create and store a new value
View Full Code Here

  public void testChangeColumnTypeLongAndObject() throws Exception
  {
    String name = "foo";
    int value = 1;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create original objects
View Full Code Here

  @Test
  public void testChangeColumnTypeObjectAndSubclass() throws Exception
  {
    String name = "foo";
    Object object = new Object();
    Object subObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create original objects
View Full Code Here

  public void testChangeColumnTypeLongAndInt() throws Exception
  {
    String name = "foo";
    int value = 1;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create original objects
View Full Code Here

  public void testChangeColumnTypeLongAndString() throws Exception
  {
    String name = "foo";
    int value = 1;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create original objects
View Full Code Here

  public void testChangeColumnTypeLongAndArray() throws Exception
  {
    String name = "foo";
    int value = 1;
    Object otherObject = new SimpleObject();
    Object redundantObject = new SimplestObject();
    PersistenceManager pm = new PersistenceManager(driver, database, login, password);
    // drop all tables
    pm.dropTable(Object.class);

    // create original objects
View Full Code Here

TOP

Related Classes of org.conserve.objects.SimplestObject

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.