|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.persvr.datasource.BaseDataSource
org.persvr.datasource.DatabaseDataSource
org.persvr.datasource.DatabaseTableDataSource
public class DatabaseTableDataSource
| Nested Class Summary | |
|---|---|
static class |
DatabaseTableDataSource.Column
|
static class |
DatabaseTableDataSource.RelationalColumn
|
static class |
DatabaseTableDataSource.RelationshipType
|
| Nested classes/interfaces inherited from class org.persvr.datasource.DatabaseDataSource |
|---|
DatabaseDataSource.DatabaseAction, DatabaseDataSource.QueryIterator, DatabaseDataSource.ThreadSpecificConnectionObject |
| Field Summary |
|---|
| Fields inherited from class org.persvr.datasource.DatabaseDataSource |
|---|
connectionString |
| 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 |
| Constructor Summary | |
|---|---|
DatabaseTableDataSource()
|
|
| Method Summary | |
|---|---|
protected org.persvr.datasource.DatabaseTableDataSource.ConnectionStatements |
getConnectionObject()
Just cast it to our specific connection object type |
java.lang.Object |
getFieldValue(LazyPropertyId valueId)
This is called when a field value contains an unfulfilled value (ValueId) |
protected java.lang.Object |
getValueFromRs(java.sql.ResultSet rs)
This gets the value/object for the current result set row |
void |
initParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
This is called on initialization and provides access to the data source configuration parameters |
void |
mapObject(PersistableInitializer initializer,
java.lang.String objectId)
This is called when an object is being activated to retrieve the persisted data for a given object |
java.util.Iterator |
mapQuery(Query query)
This is called when an object is being activated to retrieve the persisted data for a given object with a filter |
protected void |
mapResult(PersistableInitializer initializer,
java.sql.ResultSet rs,
java.lang.String objectId)
|
protected java.lang.String |
nameInQuery(java.lang.String name)
|
void |
recordDelete(java.lang.String objectId)
This is called when an object should be deleted |
void |
recordListAdd(java.lang.String objectId,
java.lang.Object value)
|
void |
recordListRemoval(java.lang.String objectId,
java.lang.Object value)
|
NewObjectPersister |
recordNewObject(Persistable object)
This is called when a new object is persisted |
void |
recordPropertyAddition(java.lang.String objectId,
java.lang.String name,
java.lang.Object value,
int attributes)
This is called when a new property is added to an object |
void |
recordPropertyChange(java.lang.String objectId,
java.lang.String name,
java.lang.Object value,
int attributes)
This is called when a property value is changed |
void |
recordPropertyRemoval(java.lang.String objectId,
java.lang.String name)
This is called when a property value is removed |
| Methods inherited from class org.persvr.datasource.DatabaseDataSource |
|---|
abortTransaction, addConditionToQuery, commitTransaction, comparison, createConnection, executeAndGetGeneratedKey, numberComparisonInQuery, runStarterStatements, startTransaction, stringComparisonInQuery, testLocks, tryExecution |
| Methods inherited from class org.persvr.datasource.BaseDataSource |
|---|
convertObjectToString, convertStringToObject, getId, hiddenId, idForString, initializeFromMap, setId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.persvr.datasource.WritableDataSource |
|---|
abortTransaction, commitTransaction, startTransaction |
| Methods inherited from interface org.persvr.datasource.DataSource |
|---|
getId, hiddenId, setId |
| Constructor Detail |
|---|
public DatabaseTableDataSource()
| Method Detail |
|---|
protected java.lang.Object getValueFromRs(java.sql.ResultSet rs)
throws java.lang.Exception
DatabaseDataSource
getValueFromRs in class DatabaseDataSourcejava.lang.Exception
public java.util.Iterator mapQuery(Query query)
throws java.lang.Exception
DataSource
mapQuery in interface DataSourcejava.lang.Exceptionprotected org.persvr.datasource.DatabaseTableDataSource.ConnectionStatements getConnectionObject()
getConnectionObject in class DatabaseDataSource
public void initParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
throws java.lang.Exception
DataSource
initParameters in interface DataSourceinitParameters in class DatabaseDataSourcejava.lang.Exception
public java.lang.Object getFieldValue(LazyPropertyId valueId)
throws java.lang.Exception
DataSource
getFieldValue in interface DataSourcejava.lang.Exception
protected void mapResult(PersistableInitializer initializer,
java.sql.ResultSet rs,
java.lang.String objectId)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.lang.String nameInQuery(java.lang.String name)
nameInQuery in class DatabaseDataSource
public void mapObject(PersistableInitializer initializer,
java.lang.String objectId)
throws java.lang.Exception
DataSource
mapObject in interface DataSourcejava.lang.Exception
public void recordListAdd(java.lang.String objectId,
java.lang.Object value)
throws java.lang.Exception
java.lang.Exception
public NewObjectPersister recordNewObject(Persistable object)
throws java.lang.Exception
WritableDataSource
recordNewObject in interface WritableDataSourcejava.lang.Exception
public void recordListRemoval(java.lang.String objectId,
java.lang.Object value)
throws java.lang.Exception
java.lang.Exception
public void recordPropertyAddition(java.lang.String objectId,
java.lang.String name,
java.lang.Object value,
int attributes)
throws java.lang.Exception
WritableDataSource
recordPropertyAddition in interface WritableDataSourcevalue - - The value should generally be an object one of the following classes: String, Boolean, Integer, Double, Date, ObjectId, or a null
If the value is an ObjectId than it indicates that it is a reference to another object.
The data source can check isPersisted to see if the object has been persisted yet. If it is true than it means
it means it has already been persisted. If it is false, the object has not been persisted yet. If the data
source can handle a new object at this point, it should call ObjectId.persist to persist the objectattributes - TODO
java.lang.Exception
public void recordPropertyChange(java.lang.String objectId,
java.lang.String name,
java.lang.Object value,
int attributes)
throws java.lang.Exception
WritableDataSource
recordPropertyChange in interface WritableDataSourceattributes - TODO
java.lang.Exception
public void recordPropertyRemoval(java.lang.String objectId,
java.lang.String name)
throws java.lang.Exception
WritableDataSource
recordPropertyRemoval in interface WritableDataSourcejava.lang.Exception
public void recordDelete(java.lang.String objectId)
throws java.lang.Exception
WritableDataSource
recordDelete in interface WritableDataSourcejava.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||