net.sf.jso.storage
Interface ObjectManager

All Known Implementing Classes:
JSOObjectManager

public interface ObjectManager

Manager responsible for object storage.


Method Summary
 void batchStore(java.util.Collection objs, boolean deep, Transaction tx)
          Stores a collection of objects in one only "batch" operation.
 int delete(java.util.List objs, Transaction tx)
          Deletes a list of objects.
 void delete(java.lang.Object obj, Transaction tx)
          Deletes an object.
 void delete(OID oid, Transaction tx)
          Deletes an object.
 CacheInfo getCacheInfo()
          Gets cache information.
 OID getOID(java.lang.Object obj)
          Returns OID of a transient storable object.
 void invalidate()
          Invalidates all cached data.
 void invalidate(java.lang.Class cls)
          Invalidates cached data of all objects of a class.
 void invalidate(OID oid)
          Invalidates cached data of an object.
 java.lang.Object retrieve(OID oid, boolean summary, boolean lazy, boolean refresh, boolean useProxy, Transaction tx)
          Retrieves an object.
 OID store(java.lang.Object obj, boolean deep, Transaction tx)
          Stores an object.
 void unlinkTransientObjects()
          Unlinks transient storable objects from stored ones.
 

Method Detail

getOID

public OID getOID(java.lang.Object obj)
           throws StorageException
Returns OID of a transient storable object.

Parameters:
obj - The object to be identified.
Returns:
Storable object's OID.
Throws:
StorageException

unlinkTransientObjects

public void unlinkTransientObjects()
Unlinks transient storable objects from stored ones.


store

public OID store(java.lang.Object obj,
                 boolean deep,
                 Transaction tx)
          throws StorageException
Stores an object.

Parameters:
obj - Object to be stored.
deep - Indicates if referenced objects should also be stored.
tx - Transaction within which operation will be executed.
Throws:
StorageException

batchStore

public void batchStore(java.util.Collection objs,
                       boolean deep,
                       Transaction tx)
                throws StorageException
Stores a collection of objects in one only "batch" operation.

Parameters:
objs - The collection of object to be stored.
deep - Indicates if referenced objects should also be stored.
tx - Transaction within which operation will be executed.
Throws:
StorageException

retrieve

public java.lang.Object retrieve(OID oid,
                                 boolean summary,
                                 boolean lazy,
                                 boolean refresh,
                                 boolean useProxy,
                                 Transaction tx)
                          throws StorageException
Retrieves an object.

Parameters:
oid - Identification of the object to be retrieved.
summary - Indicates if only summary fields should be retrieved. filled with elements/references (true) or only references to them (false).
lazy - Indicates if referenced objects should be lazy loaded, by proxy objetcs.
refresh - Indicates if an existent transient version of storable object should be refreshd with data from database.
useProxy - Indicates if a proxy may be returned instead of a real storable object.
tx - Transaction within which operation will be executed.
Throws:
StorageException

delete

public void delete(java.lang.Object obj,
                   Transaction tx)
            throws StorageException
Deletes an object.

Parameters:
obj - Object to be deleted.
tx - Transaction within which operation will be executed.
Throws:
StorageException

delete

public void delete(OID oid,
                   Transaction tx)
            throws StorageException
Deletes an object.

Parameters:
oid - Identification of the object to be deleted.
tx - Transaction within which operation will be executed.
Throws:
StorageException

delete

public int delete(java.util.List objs,
                  Transaction tx)
           throws StorageException
Deletes a list of objects.

Parameters:
objs - List of objects to be deleted.
tx - Transaction within which operation will be executed.
Throws:
StorageException

invalidate

public void invalidate()
Invalidates all cached data.


invalidate

public void invalidate(OID oid)
Invalidates cached data of an object.

Parameters:
oid - Object's identification.

invalidate

public void invalidate(java.lang.Class cls)
Invalidates cached data of all objects of a class.

Parameters:
cls - Object's class.

getCacheInfo

public CacheInfo getCacheInfo()
Gets cache information.

Returns:
Information about the cache.