Queries
For instance, ODB has five ways to retrieve objects:
- Retrieving all objects of a specific class
- Retrieving a subset of objects of a specific class using CriteriaQuery
- Retrieving a subset of objects of a specific class using NativeQuery
- Retrieving an object by its OID
- Retrieving Object specific values
All Objects of a specific class
If you just want to retrieve all the objects of a specific class, the following method can be used:
Objects objects = odb.getObject(MyClass.class);
Criteria Queries
Native Queries
Object by OID
If you have the OID of an object, the following method can be used to get the object:
MyClass object = (MyClass) odb.getObjectFromId(oids);
Object Values API
Have a look at this powerful API that let you retrieve values of objects instead of whole objects!
page revision: 1, last edited: 07 Oct 2011 19:36