org.persvr.datasource.oodb
Class DynaObjectDBSource
java.lang.Object
org.persvr.datasource.BaseDataSource
org.persvr.datasource.DatabaseDataSource
org.persvr.datasource.oodb.DynaObjectDBSource
- All Implemented Interfaces:
- DataSource, DataSourceCanHaveOrphans, ListDataSource, ReferenceAwareDataSource, SourceDeleteAware, WritableDataSource
public class DynaObjectDBSource
- extends DatabaseDataSource
- implements WritableDataSource, DataSource, ListDataSource, DataSourceCanHaveOrphans, ReferenceAwareDataSource, SourceDeleteAware
This is the dynamic object database source. This is the default primary data
source used by Persevere.
- Author:
- Kris
| Fields inherited from class org.persvr.datasource.BaseDataSource |
BINARY_HEADER, BOOLEAN_FALSE, BOOLEAN_TRUE, DATE_HEADER, DECIMAL_HEADER, DOUBLE_HEADER, FUNCTION_HEADER, INTEGER_HEADER, LINK_HEADER, LONG_HEADER, OBJECT_HEADER, REQUIRED_PREFIX, STRING_HEADER, UNDEFINED |
| Methods inherited from class org.persvr.datasource.DatabaseDataSource |
abortTransaction, addConditionToQuery, comparison, createConnection, executeAndGetGeneratedKey, getConnectionObject, getValueFromRs, initParameters, nameInQuery, numberComparisonInQuery, runStarterStatements, startTransaction, stringComparisonInQuery, testLocks, tryExecution |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DynaObjectDBSource
public DynaObjectDBSource()
commitTransaction
public void commitTransaction()
throws java.lang.Exception
- Specified by:
commitTransaction in interface WritableDataSource- Overrides:
commitTransaction in class DatabaseDataSource
- Throws:
java.lang.Exception
mapObject
public void mapObject(PersistableInitializer initializer,
java.lang.String objectId)
throws java.lang.Exception
- Description copied from interface:
DataSource
- This is called when an object is being activated to retrieve the persisted data for a given object
- Specified by:
mapObject in interface DataSource
- Throws:
java.lang.Exception
getFieldValue
public java.lang.Object getFieldValue(LazyPropertyId valueId)
throws java.sql.SQLException
- Description copied from interface:
DataSource
- This is called when a field value contains an unfulfilled value (ValueId)
- Specified by:
getFieldValue in interface DataSource
- Returns:
- the real value referred to by valueId
- Throws:
java.sql.SQLException
getReferrers
public java.util.List<ObjectId> getReferrers(java.lang.String id)
- Specified by:
getReferrers in interface ReferenceAwareDataSource
recordObjectChange
public void recordObjectChange(Persistable object)
recordPropertyRemoval
public void recordPropertyRemoval(java.lang.String id,
java.lang.String name)
throws java.sql.SQLException
- Description copied from interface:
WritableDataSource
- This is called when a property value is removed
- Specified by:
recordPropertyRemoval in interface WritableDataSource
- Throws:
java.sql.SQLException
recordListAdd
public void recordListAdd(java.lang.String objectId,
int index,
java.lang.Object value)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
testQuery
public java.util.List testQuery(java.lang.String sql)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
recordList
public void recordList(java.lang.String id,
java.util.List<? extends java.lang.Object> values)
throws java.sql.SQLException
- Specified by:
recordList in interface ListDataSource
- Throws:
java.sql.SQLException
recordDelete
public void recordDelete(java.lang.String objectId)
throws java.lang.Exception
- Description copied from interface:
WritableDataSource
- This is called when an object should be deleted
- Specified by:
recordDelete in interface WritableDataSource
- Throws:
java.lang.Exception
truncate
public void truncate(java.lang.String objectId,
long newLength)
throws java.lang.Exception
- Throws:
java.lang.Exception
newSource
public java.util.Map<java.lang.String,java.lang.Object> newSource()
throws java.lang.Exception
- Throws:
java.lang.Exception
onDelete
public void onDelete()
throws java.lang.Exception
- Description copied from interface:
SourceDeleteAware
- When a source is deleted this is called
- Specified by:
onDelete in interface SourceDeleteAware
- Throws:
java.lang.Exception
getSuperSource
public DynaObjectDBSource getSuperSource()