net.sf.jso.storage
Interface DataManager

All Known Implementing Classes:
JSODataManager

public interface DataManager

Manager responsible for object data storage.


Method Summary
 void createObject(ObjectFieldData data, StorableClass cls, Transaction tx)
          Creates an object with suplied data.
 void deleteObject(OID oid, StorableClass cls, Transaction tx)
          Deletes an object.
 CacheInfo getCacheInfo()
          Gets cache information.
 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.
 ObjectFieldData readObject(OID oid, boolean summary, StorableClass cls, Transaction tx)
          Reads an object's data.
 boolean updateObject(ObjectFieldData data, StorableClass cls, Transaction tx)
          Updates object's data.
 

Method Detail

createObject

public void createObject(ObjectFieldData data,
                         StorableClass cls,
                         Transaction tx)
                  throws java.sql.SQLException,
                         StorageException
Creates an object with suplied data.

Parameters:
data - Object's data.
cls - Object's class.
tx - Transaction within which the operation will be made.
Throws:
java.sql.SQLException
StorageException

readObject

public ObjectFieldData readObject(OID oid,
                                  boolean summary,
                                  StorableClass cls,
                                  Transaction tx)
                           throws java.sql.SQLException,
                                  StorageException,
                                  ObjectNotFoundException
Reads an object's data.

Parameters:
oid - Object's identification.
summary - Indicates if only summary should be read.
cls - Object's class.
tx - Transaction within which the operation will be made.
Returns:
Object's data.
Throws:
java.sql.SQLException
StorageException
ObjectNotFoundException

updateObject

public boolean updateObject(ObjectFieldData data,
                            StorableClass cls,
                            Transaction tx)
                     throws java.sql.SQLException,
                            StorageException
Updates object's data.

Parameters:
data - Object's data.
cls - Object's class.
tx - Transaction within which the operation will be made.
Returns:
If object has been updated in database.
Throws:
java.sql.SQLException
StorageException

deleteObject

public void deleteObject(OID oid,
                         StorableClass cls,
                         Transaction tx)
                  throws java.sql.SQLException,
                         StorageException
Deletes an object.

Parameters:
oid - Object's identification.
cls - Object's class.
tx - Transaction within which the operation will be made.
Throws:
java.sql.SQLException
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.