net.sf.jso.storage
Class JSODataManager

java.lang.Object
  extended bynet.sf.jso.storage.JSODataManager
All Implemented Interfaces:
DataManager

public class JSODataManager
extends java.lang.Object
implements DataManager

Manager responsible for object data storage.


Constructor Summary
JSODataManager(int cacheSize)
          Constructs the data manager.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSODataManager

public JSODataManager(int cacheSize)
Constructs the data manager.

Method Detail

createObject

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

Specified by:
createObject in interface DataManager
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
Reads an object's data.

Specified by:
readObject in interface DataManager
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

updateObject

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

Specified by:
updateObject in interface DataManager
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.

Specified by:
deleteObject in interface DataManager
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.

Specified by:
invalidate in interface DataManager

invalidate

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

Specified by:
invalidate in interface DataManager
Parameters:
oid - Object's identification.

invalidate

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

Specified by:
invalidate in interface DataManager
Parameters:
cls - Object's class.

getCacheInfo

public CacheInfo getCacheInfo()
Gets cache information.

Specified by:
getCacheInfo in interface DataManager
Returns:
Information about the cache.