| com.mobixess.jodb.soda.api.ObjectContainer
All known Subclasses: com.mobixess.jodb.core.JODBSessionContainer,
ObjectContainer | public interface ObjectContainer (Code) | | database engine interface.
The ObjectContainer interface provides all methods
to store, retrieve and delete objects and to change object state.
|
Method Summary | |
public void | activate(Object obj, int depth) Activates all members on a stored object to the specified depth. | public boolean | close() closes the ObjectContainer . | public void | commit() Commits the running transaction. | public void | deactivate(Object obj, int depth) deactivates a stored object by setting all members to NULL . | public void | delete(Object obj) deletes a stored object permanently.
Note that this method has to be called for every single object
individually. | public ObjectSet<T> | get(Object template) Query-By-Example interface to retrieve objects.
get() creates an
ObjectSet ObjectSet containing
all objects in the ObjectContainer that match the passed
template object.
Calling get(NULL) returns all objects stored in the
ObjectContainer .
Query Evaluation
All non-null members of the template object are compared against
all stored objects of the same class.
Primitive type members are ignored if they are 0 or false respectively.
Returned Objects
The objects returned in the
ObjectSet ObjectSet are instantiated
and activated to the preconfigured depth. | public Query | query() creates a new S.O.D.A. | public ObjectSet<Type> | query(Class<Type> clazz) queries for all instances of a class.
Parameters: clazz - the class to query for. | public void | rollback() rolls back the running transaction. | public void | set(Object obj) Newly stores objects or updates stored objects.
An object not yet stored in the ObjectContainer will be
stored when it is passed to set() . | public void | set(Object obj, int depth) Newly stores objects or updates stored objects.
An object not yet stored in the ObjectContainer will be
stored when it is passed to set() . |
close | public boolean close() throws IOException(Code) | | closes the ObjectContainer .
A call to close() automatically performs a
ObjectContainer.commit commit() .
Every session opened with JODB.openFile() requires one
close()call, even if the same filename was used multiple times.
Use while(!close()){} to close all sessions using this container.
success - true denotes that the last used instance of this containerand the database file were closed. throws: IOException - |
deactivate | public void deactivate(Object obj, int depth)(Code) | | deactivates a stored object by setting all members to NULL .
Primitive types will be set to their default values.
The method has no effect, if the passed object is not stored in the
ObjectContainer
Parameters: obj - the object to be deactivated. Parameters: depth - the member to which deactivate is to cascade. |
delete | public void delete(Object obj) throws IOException(Code) | | deletes a stored object permanently.
Note that this method has to be called for every single object
individually. Delete does not recurse to object members. Simple
and array member types are destroyed.
The method has no effect, if
the passed object is not stored in the ObjectContainer .
which can be also used for cascaded deletes.
Parameters: obj - the object to be deleted from theObjectContainer .
throws: IOException - |
set | public void set(Object obj) throws IllegalClassTypeException, IOException(Code) | | Newly stores objects or updates stored objects.
An object not yet stored in the ObjectContainer will be
stored when it is passed to set() . An object already stored
in the ObjectContainer will be updated.
Parameters: obj - the object to be stored or updated. throws: IOException - {@link IllegalClassTypeException} |
set | public void set(Object obj, int depth) throws IllegalClassTypeException, IOException(Code) | | Newly stores objects or updates stored objects.
An object not yet stored in the ObjectContainer will be
stored when it is passed to set() . An object already stored
in the ObjectContainer will be updated.
Parameters: obj - the object to be stored or updated. Parameters: depth - the depth to which the object is to be updated throws: IllegalClassTypeException - throws: IOException - |
|
|