Package org.conserve.objects

Examples of org.conserve.objects.ComplexObject


    // add a large number of entries
    for (int x = 0; x < 200; x++)
    {
      SimplestObject so = new SimplestObject();
      so.setFoo((double) x);
      ComplexObject co = new ComplexObject();
      co.setSimplestObject(so);
      persist.saveObject(cw, co);
    }
    cw.commitAndDiscard();
    // make sure all entries have been added
    List<ComplexObject> list = persist.getObjectsMatching(new ComplexObject());
    assertEquals(200, list.size());
    // select using sorting
    SimplestObject simpleObject = new SimplestObject();
    simpleObject.setFoo(0.0);
    ComplexObject orderObject = new ComplexObject();
    orderObject.setSimplestObject(simpleObject);

    list = persist.getObjects(ComplexObject.class, new Descending(orderObject));
    assertEquals(200, list.size());
    assertEquals((Double) 199.0, list.get(0).getSimplestObject().getFoo());
    list = persist.getObjects(ComplexObject.class, new Ascending(orderObject));
View Full Code Here

TOP

Related Classes of org.conserve.objects.ComplexObject

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.