com.objectwave.persist.mapping
Class RDBPersistentAdapter

java.lang.Object
  |
  +--com.objectwave.transactionalSupport.ObjectEditor
        |
        +--com.objectwave.persist.mapping.RDBPersistentAdapter
All Implemented Interfaces:
ObjectEditingView, Persistence, RDBPersistence, java.io.Serializable, SetAndGetDelegateIF, TransactionalObjectIF
Direct Known Subclasses:
JoinAdapter, RDBExtendablePersistentAdapter

public class RDBPersistentAdapter
extends ObjectEditor
implements RDBPersistence

Used to make creating persistent objects fairly painless. Much of the logic necessary for our persistence solution resides in the class and RDBBroker.

Version:
$Id: RDBPersistentAdapter.java,v 2.5 2002/03/09 17:13:47 dave_hoag Exp $
Author:
Dave Hoag
See Also:
RDBBroker, Serialized Form

Nested Class Summary
static class RDBPersistentAdapter.Test
           
 
Nested classes inherited from class com.objectwave.transactionalSupport.ObjectEditor
ObjectEditor.Test
 
Field Summary
protected  boolean brokerGeneratedPrimaryKeys
           
 MapInformation mi
           
 
Fields inherited from class com.objectwave.transactionalSupport.ObjectEditor
dataExchange, fds, security
 
Constructor Summary
RDBPersistentAdapter(Persistence p)
          Constructor:
RDBPersistentAdapter(Persistence p, java.lang.String brokerName)
          Constructor:
 
Method Summary
protected  boolean accessed(java.lang.reflect.Field f, java.lang.Object[] dataVal, java.lang.Object curValue)
          We are accessing Field and the contents of field F may be in a state of flux.
 void addCollectionQuery(java.lang.String name, SQLQuery q)
          To provide support for collections, we needed to do something clever.
 void addToStream(java.io.ObjectOutputStream out)
          Preserve certain fields related to persistence.
protected  void asNoLongerProxy(RDBPersistentAdapter target, Persistence source)
          Copy the data from the object found in the database into the object that was representing our proxy.
 Persistence basicNew()
          Create a new instance of the persistentObject.
 boolean containsAttributeChanges(TransactionLog log)
          If we have any changes which are not the result of a collection change, return true.
protected  void copyFrom(Persistence newObj)
          Update the current persistent object with the values from the argument.
 void delete()
          Remove this object from the persistent store.
 boolean equals(java.lang.Object obj)
           
 AttributeTypeColumn findColumnMap(java.lang.String path)
          From the provided path, find the Attribute type column it represents.
protected  AttributeTypeColumn findMatch(AttributeTypeColumn[] types, Persistence type)
          The collection of types may contain a reference to the argument.
 AttributeTypeColumn foreignKeyBackRef(RDBPersistence joinObj)
          Find my instance link reference to the arguments foreign key reference.
 AttributeTypeColumn foreignKeyJoinColumn(RDBPersistence joinObj, java.lang.reflect.Field fieldOverride)
          The foreignKeyJoin value is almost always the primaryKeyField of the other object.
 java.lang.Object foreignKeyJoinData(RDBPersistence joinObj)
          The foreignKeyJoin value is almost always the primaryKeyField of the other object.
 java.lang.Object get(java.lang.reflect.Field adapt, java.lang.Object oldValue)
          This is how we manage our proxies.
 Persistence getAdapter()
          Since we are the adapter, we should never have an adapter.
 AttributeTypeColumn[] getAttributeDescriptions()
           
 boolean getBrokerGeneratedPrimaryKeys()
           
 java.lang.String getBrokerName()
          Broker names allow an application to have multiple brokers.
 java.util.Vector getClassDescription()
          The mi contains the vector for the defined class.
 AttributeTypeColumn[] getCollectionDescriptions()
           
 java.util.Hashtable getCollectionQueries()
           
 AttributeTypeColumn[] getCollectionTypes(RDBPersistence pRef)
          Default is to return the collectionDescriptions.
 AttributeTypeColumn[] getForeignKeyDescriptions()
           
 AttributeTypeColumn[] getForeignKeyTypes(RDBPersistence refObj)
           
 Persistence getInstance(RDBPersistence refObj, java.lang.String classValue)
          In the event that we don't really want a new instance of the persistent object override this method to return the Persistent object you wish to have.
 AttributeTypeColumn[] getInstanceLinkDescriptions()
           
 AttributeTypeColumn[] getInstanceLinkTypes(RDBPersistence pRef)
           
 ObjectEditingView getObjectEditor()
          This method must ALWAYS return a value.
 Persistence getPersistentObject()
          Use this convenience method to do the casting of the domain object to a persistent object.
 AttributeTypeColumn getPrimaryAttributeDescription()
           
 java.lang.String getPrimaryKeyColumn()
          The default primary key column name is the first entry in the attribute column name list.
 AttributeTypeColumn[] getPrimaryKeyDescriptions()
           
 java.lang.Object getPrimaryKeyField()
          Get the object found in my primary key field.
 java.lang.Object[] getPrimaryKeyFields()
          Get the objects found in my primary key field.
 int getRecordOffset()
          Record offset is used when building the objects.
 java.lang.String getTableName(java.lang.Object refObj)
          Return the object's table name.
 int hashCode()
          Make adapter instances hash on primary key value.
 void insert()
          Force an object to be 'changed' so that it will be commited when the transaction is commited.
 AttributeTypeColumn instanceLinkJoinColumn(RDBPersistence joinObj)
          Find my foreignKey or instanceLink column that points to the parameter.
 java.util.Collection instanceLinkJoinColumns(RDBPersistence joinObj)
          Find my foreignKey or instanceLink columns that points to the parameter.
 boolean isDeleteThis()
          Gets the DeleteThis attribute of the RDBPersistentAdapter object
 boolean isProxy()
          The proxy attribute is used by this class to determine if this object has been fetched from the database.
 boolean isRetrievedFromDatabase()
          Gets the RetrievedFromDatabase attribute of the Persistence object
 void markForDelete()
          Set the delete flag, and enter this change into the current transaction log.
protected  java.lang.Object potentialProxyGet(java.lang.reflect.Field adapt)
          The value being retrieved may 'change' if it's a proxy.
 Persistence realizeProxy(Persistence p)
          The argument is a proxy.
 void save()
          Save this object to the persistent store.
 void serializedUpdate(java.io.ObjectInputStream oin)
          Get the data that should be preserved when serializing persistent objects.
 void set(java.lang.reflect.Field adapt, java.lang.Object val, java.lang.Object originalVal)
          This is how we manage our proxies.
 void setBrokerGeneratedPrimaryKeys(boolean newValue)
           
 void setBrokerName(java.lang.String st)
          The brokerName attribute allows persistent objects from different databases to co-mingle.
 void setClassDescription(java.util.Vector v)
          Every instance of this class must have the map for the Persistent object.
 void setCollectionQueries(java.util.Hashtable t)
          Collections are 'proxied' until they are requested.
 void setCustomData(java.lang.Object key, java.lang.Object value)
          Allow broker to associate custom data with an RDBPersistentAdapter instance.
 void setObjectEditor(ObjectEditingView e)
           
 void setPrimaryKeyField(java.lang.Object i)
          Could be overidden for optimization.
 void setProxy(boolean b)
          The proxy attribute is used by this class to determine if this object has been fetched from the database.
 void setRecordOffset(int i)
           
 void setRetrievedFromDatabase(boolean b)
          This is different from the 'proxy' attribute in that an object that came from the database will have this attribute of true.
 void setSkipScalarCheck(boolean newValue)
          Used to optimize inserts and updates.
 void setTableName(java.lang.String name)
          If we know the table name, we can set it here.
protected  void setValue(java.lang.reflect.Field adapt, java.lang.Object val, java.lang.Object originalVal)
          The main workhorse method for all of the set methods.
 boolean skipScalarCheck()
          If it is known that there are no Scalar arrays for this object, this value can be set to false.
 void update(boolean get, java.lang.Object[] data, java.lang.reflect.Field[] fields)
          Pass my 'update' request to my represented persistent object.
 boolean usesAdapter()
          Since we are the adapter, we should never need an adapter.
 
Methods inherited from class com.objectwave.transactionalSupport.ObjectEditor
changes, clearChanges, clearChanges, commit, containsAnyChanges, get, get, get, get, get, get, get, get, get, getCollectionChanges, getDomainField, getDomainObject, getFieldMap, getMods, getSecurity, getValue, isDirty, isTransient, lock, lockedBy, markChange, migrateChanges, noKnownLogs, putFieldMap, putMod, quickChanges, rollback, set, set, set, set, set, set, set, set, set, set, setAsTransient, setDomainField, setSecurity, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.objectwave.persist.RDBPersistence
containsAnyChanges, getDomainObject
 
Methods inherited from interface com.objectwave.persist.Persistence
lock, unlock
 
Methods inherited from interface com.objectwave.transactionalSupport.TransactionalObjectIF
isDirty, isTransient, setAsTransient
 

Field Detail

mi

public transient MapInformation mi

brokerGeneratedPrimaryKeys

protected boolean brokerGeneratedPrimaryKeys
Constructor Detail

RDBPersistentAdapter

public RDBPersistentAdapter(Persistence p)
Constructor:

Parameters:
p -

RDBPersistentAdapter

public RDBPersistentAdapter(Persistence p,
                            java.lang.String brokerName)
Constructor:

Parameters:
p -
brokerName -
Method Detail

setCustomData

public void setCustomData(java.lang.Object key,
                          java.lang.Object value)
Allow broker to associate custom data with an RDBPersistentAdapter instance. Not for use by normal code.

Parameters:
value - If null, remove entry from custom data list.
key - The new CustomData value

set

public void set(java.lang.reflect.Field adapt,
                java.lang.Object val,
                java.lang.Object originalVal)
This is how we manage our proxies.

Specified by:
set in interface SetAndGetDelegateIF
Overrides:
set in class ObjectEditor
Parameters:
adapt -
val -
originalVal -
See Also:
ObjectEditor

setBrokerGeneratedPrimaryKeys

public void setBrokerGeneratedPrimaryKeys(boolean newValue)
Parameters:
newValue - int

setClassDescription

public void setClassDescription(java.util.Vector v)
Every instance of this class must have the map for the Persistent object. This map is defined in the Vector v. It is assumed that the Vector v contains the same information for every instance of a particular Persistent class. We associate a map information with the domain object's class. Every instance of that domain object's class will reuse the same map information.

Parameters:
v - Vector containing map information.

setBrokerName

public void setBrokerName(java.lang.String st)
The brokerName attribute allows persistent objects from different databases to co-mingle.

Specified by:
setBrokerName in interface Persistence
Parameters:
st - The new BrokerName value

setCollectionQueries

public void setCollectionQueries(java.util.Hashtable t)
Collections are 'proxied' until they are requested. To 'proxy' the collection, a SQLQuery is simply placed in the collection queries hashtable.

Specified by:
setCollectionQueries in interface RDBPersistence
Parameters:
t - A collection of SQLQuery objects indexed by the field they represent.

setObjectEditor

public void setObjectEditor(ObjectEditingView e)
Specified by:
setObjectEditor in interface TransactionalObjectIF
Parameters:
e - The new ObjectEditor value

setPrimaryKeyField

public void setPrimaryKeyField(java.lang.Object i)
Could be overidden for optimization.

Specified by:
setPrimaryKeyField in interface RDBPersistence
Parameters:
i - The new PrimaryKeyField value

setProxy

public void setProxy(boolean b)
The proxy attribute is used by this class to determine if this object has been fetched from the database. If a method is sent to this object, and this object is a proxy, the data will be retreived from the database.

Specified by:
setProxy in interface RDBPersistence
Parameters:
b - The new Proxy value

setRecordOffset

public void setRecordOffset(int i)
Specified by:
setRecordOffset in interface RDBPersistence
Parameters:
i - The new RecordOffset value
See Also:
getRecordOffset()

setRetrievedFromDatabase

public void setRetrievedFromDatabase(boolean b)
This is different from the 'proxy' attribute in that an object that came from the database will have this attribute of true. While a proxy is only true, until it is realized. So, all proxy objects are

Specified by:
setRetrievedFromDatabase in interface Persistence
Parameters:
b -

setSkipScalarCheck

public void setSkipScalarCheck(boolean newValue)
Used to optimize inserts and updates. If we know that we do not have any Scalar arrays in our attribute collection, we can set this value to true.

Specified by:
setSkipScalarCheck in interface RDBPersistence
Parameters:
newValue - boolean

setTableName

public void setTableName(java.lang.String name)
If we know the table name, we can set it here.

Parameters:
name - The name of the database table containing this object.

setValue

protected void setValue(java.lang.reflect.Field adapt,
                        java.lang.Object val,
                        java.lang.Object originalVal)
The main workhorse method for all of the set methods. Method is overloaded to check for changes in the primary key fields.

Overrides:
setValue in class ObjectEditor
Parameters:
adapt - The new Value value
val - The new Value value
originalVal - The new Value value

get

public java.lang.Object get(java.lang.reflect.Field adapt,
                            java.lang.Object oldValue)
This is how we manage our proxies.

Specified by:
get in interface SetAndGetDelegateIF
Overrides:
get in class ObjectEditor
Parameters:
adapt -
oldValue -
Returns:
See Also:
ObjectEditor

getAdapter

public Persistence getAdapter()
Since we are the adapter, we should never have an adapter.

Specified by:
getAdapter in interface Persistence
Returns:
The Adapter value

getAttributeDescriptions

public AttributeTypeColumn[] getAttributeDescriptions()
Specified by:
getAttributeDescriptions in interface RDBPersistence
Returns:
The AttributeDescriptions value

getBrokerGeneratedPrimaryKeys

public boolean getBrokerGeneratedPrimaryKeys()
Specified by:
getBrokerGeneratedPrimaryKeys in interface RDBPersistence
Returns:
int

getBrokerName

public java.lang.String getBrokerName()
Description copied from interface: Persistence
Broker names allow an application to have multiple brokers. Every PersistentObject can be associated with only one broker.

Specified by:
getBrokerName in interface Persistence
Returns:
java.lang.String

getCollectionDescriptions

public AttributeTypeColumn[] getCollectionDescriptions()
Specified by:
getCollectionDescriptions in interface RDBPersistence
Returns:
The CollectionDescriptions value

getCollectionQueries

public java.util.Hashtable getCollectionQueries()
Specified by:
getCollectionQueries in interface RDBPersistence
Returns:
The CollectionQueries value

getCollectionTypes

public AttributeTypeColumn[] getCollectionTypes(RDBPersistence pRef)
Default is to return the collectionDescriptions. Override if the pRef will change the collection types.

Specified by:
getCollectionTypes in interface RDBPersistence
Parameters:
pRef -
Returns:
The CollectionTypes value

getForeignKeyDescriptions

public AttributeTypeColumn[] getForeignKeyDescriptions()
Specified by:
getForeignKeyDescriptions in interface RDBPersistence
Returns:
The ForeignKeyDescriptions value

getPrimaryKeyDescriptions

public AttributeTypeColumn[] getPrimaryKeyDescriptions()
Specified by:
getPrimaryKeyDescriptions in interface RDBPersistence
Returns:
The PrimaryKeyDescriptions value

getForeignKeyTypes

public AttributeTypeColumn[] getForeignKeyTypes(RDBPersistence refObj)
Specified by:
getForeignKeyTypes in interface RDBPersistence
Parameters:
refObj -
Returns:
a collection of all of the Attributes that constitute a foreign key relation.

getInstance

public Persistence getInstance(RDBPersistence refObj,
                               java.lang.String classValue)
                        throws java.lang.InstantiationException,
                               java.lang.IllegalAccessException
In the event that we don't really want a new instance of the persistent object override this method to return the Persistent object you wish to have. This is usefull for subclass arangements.

Specified by:
getInstance in interface RDBPersistence
Parameters:
refObj -
classValue -
Returns:
The Instance value
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

getInstanceLinkDescriptions

public AttributeTypeColumn[] getInstanceLinkDescriptions()
Specified by:
getInstanceLinkDescriptions in interface RDBPersistence
Returns:
The InstanceLinkDescriptions value

getInstanceLinkTypes

public AttributeTypeColumn[] getInstanceLinkTypes(RDBPersistence pRef)
Specified by:
getInstanceLinkTypes in interface RDBPersistence
Parameters:
pRef -
Returns:
a collection of all of the Attributes that constitute a instance link relation.

getObjectEditor

public ObjectEditingView getObjectEditor()
Description copied from interface: TransactionalObjectIF
This method must ALWAYS return a value.

Specified by:
getObjectEditor in interface TransactionalObjectIF
Returns:
The ObjectEditor value

getPersistentObject

public final Persistence getPersistentObject()
Use this convenience method to do the casting of the domain object to a persistent object. If a Persistence object is not needed, just use the getDomainObject method. This will avoid an unnecessary cast.

Specified by:
getPersistentObject in interface RDBPersistence
Returns:
The PersistentObject value

getPrimaryAttributeDescription

public AttributeTypeColumn getPrimaryAttributeDescription()
Specified by:
getPrimaryAttributeDescription in interface RDBPersistence
Returns:
The PrimaryAttributeDescription value

getPrimaryKeyColumn

public java.lang.String getPrimaryKeyColumn()
The default primary key column name is the first entry in the attribute column name list.

Specified by:
getPrimaryKeyColumn in interface RDBPersistence
Returns:
The PrimaryKeyColumn value

getPrimaryKeyField

public java.lang.Object getPrimaryKeyField()
Get the object found in my primary key field.

Specified by:
getPrimaryKeyField in interface RDBPersistence
Returns:
The PrimaryKeyField value

getPrimaryKeyFields

public java.lang.Object[] getPrimaryKeyFields()
Get the objects found in my primary key field.

Specified by:
getPrimaryKeyFields in interface RDBPersistence
Returns:
The PrimaryKeyField value

getRecordOffset

public int getRecordOffset()
Record offset is used when building the objects. We may have done a join with our select statement. In which case the first data element of our object may not be found at position 0 in the data set. This offset helps us determine object boundries.

Specified by:
getRecordOffset in interface RDBPersistence
Returns:
Starting position of sql data set from which to build this object.

getTableName

public java.lang.String getTableName(java.lang.Object refObj)
Return the object's table name. Override this method if an object is found in more than one table.

Specified by:
getTableName in interface RDBPersistence
Parameters:
refObj - By default the parameter is ignored. The table name should be constant.
Returns:
The TableName value

isDeleteThis

public boolean isDeleteThis()
Gets the DeleteThis attribute of the RDBPersistentAdapter object

Specified by:
isDeleteThis in interface RDBPersistence
Returns:
The DeleteThis value

isProxy

public boolean isProxy()
The proxy attribute is used by this class to determine if this object has been fetched from the database. If a method is sent to this object, and this object is a proxy, the data will be retreived from the database.

Specified by:
isProxy in interface RDBPersistence
Returns:
boolean indicating if this object is a proxy.

isRetrievedFromDatabase

public boolean isRetrievedFromDatabase()
Description copied from interface: Persistence
Gets the RetrievedFromDatabase attribute of the Persistence object

Specified by:
isRetrievedFromDatabase in interface Persistence
Returns:
The RetrievedFromDatabase value

getClassDescription

public java.util.Vector getClassDescription()
The mi contains the vector for the defined class.

Specified by:
getClassDescription in interface RDBPersistence
Returns:
The ClassDescription value

addCollectionQuery

public void addCollectionQuery(java.lang.String name,
                               SQLQuery q)
To provide support for collections, we needed to do something clever. At each field name that is a collection, we place a SQLQuery that will result in that collection. When we realize a collection proxy we check this hashtable for the appropriate query. Once we successfully realize this proxy we remove the query from the hashtable.

Specified by:
addCollectionQuery in interface RDBPersistence
Parameters:
name - The feature to be added to the CollectionQuery attribute
q - The feature to be added to the CollectionQuery attribute

basicNew

public Persistence basicNew()
                     throws java.lang.InstantiationException,
                            java.lang.IllegalAccessException
Create a new instance of the persistentObject.

Returns:
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

containsAttributeChanges

public boolean containsAttributeChanges(TransactionLog log)
If we have any changes which are not the result of a collection change, return true. Similar to isDirty, but only ignores collection changes.

Overrides:
containsAttributeChanges in class ObjectEditor
Parameters:
log -
Returns:
See Also:
ObjectEditor.isDirty()

delete

public void delete()
            throws QueryException
Remove this object from the persistent store.

Specified by:
delete in interface Persistence
Throws:
QueryException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:

hashCode

public int hashCode()
Make adapter instances hash on primary key value.

Overrides:
hashCode in class java.lang.Object
Returns:

foreignKeyBackRef

public AttributeTypeColumn foreignKeyBackRef(RDBPersistence joinObj)
Find my instance link reference to the arguments foreign key reference. I may not have one, but that's no big deal.

Specified by:
foreignKeyBackRef in interface RDBPersistence
Parameters:
joinObj -
Returns:

foreignKeyJoinColumn

public AttributeTypeColumn foreignKeyJoinColumn(RDBPersistence joinObj,
                                                java.lang.reflect.Field fieldOverride)
The foreignKeyJoin value is almost always the primaryKeyField of the other object. It will first attempt to match the correct Field. If no match is found, it returns the default primary key.

Specified by:
foreignKeyJoinColumn in interface RDBPersistence
Parameters:
joinObj -
fieldOverride -
Returns:

foreignKeyJoinData

public java.lang.Object foreignKeyJoinData(RDBPersistence joinObj)
The foreignKeyJoin value is almost always the primaryKeyField of the other object. If this is different, then you'll need to override this method.

Parameters:
joinObj -
Returns:

insert

public void insert()
            throws QueryException
Force an object to be 'changed' so that it will be commited when the transaction is commited.

Specified by:
insert in interface Persistence
Throws:
QueryException

instanceLinkJoinColumn

public AttributeTypeColumn instanceLinkJoinColumn(RDBPersistence joinObj)
Find my foreignKey or instanceLink column that points to the parameter. Often times used by the parameter, who has me as an instance link column.

Specified by:
instanceLinkJoinColumn in interface RDBPersistence
Parameters:
joinObj - Another persistent object to which this object may join.
Returns:
AttributeTypeColumn of my foreignKey or instance link reference. Also returns null if I have no relation to the parameter.

instanceLinkJoinColumns

public java.util.Collection instanceLinkJoinColumns(RDBPersistence joinObj)
Find my foreignKey or instanceLink columns that points to the parameter. Often times used by the parameter, who has me as an instance link column.

Parameters:
joinObj - Another persistent object to which this object may join.
Returns:
AttributeTypeColumn of my foreignKey or instance link reference. Also returns null if I have no relation to the parameter.

markForDelete

public void markForDelete()
                   throws QueryException
Set the delete flag, and enter this change into the current transaction log. I've created this method to preserve the idea that the 'save' and 'delete' methods are always executed immediately!

Specified by:
markForDelete in interface RDBPersistence
Throws:
QueryException

realizeProxy

public Persistence realizeProxy(Persistence p)
The argument is a proxy. Issue a query that will either fill the existing object with data, or return a new object if the realization returns a different 'Class' of object. That may happen in the event of inheritance. NOTE: If I'm not a proxy, just return the parameter p.

Parameters:
p -
Returns:

save

public void save()
          throws QueryException
Save this object to the persistent store. Any exception that occurrs will be wrapped in an instance of QueryException. This isolates the developer from persistence solution specific exceptions.

Specified by:
save in interface Persistence
Throws:
QueryException

skipScalarCheck

public boolean skipScalarCheck()
If it is known that there are no Scalar arrays for this object, this value can be set to false.

Specified by:
skipScalarCheck in interface RDBPersistence
Returns:
boolean
See Also:
setSkipScalarCheck(boolean)

update

public void update(boolean get,
                   java.lang.Object[] data,
                   java.lang.reflect.Field[] fields)
Pass my 'update' request to my represented persistent object.

Specified by:
update in interface TransactionalObjectIF
Parameters:
get - true if this is to get values from the object, false if it is to set values.
data - The object array containing (or going to contain) the data.
fields - The fields on the object to update.

usesAdapter

public boolean usesAdapter()
Since we are the adapter, we should never need an adapter. Exists primarily to conform to Persistence interface.

Specified by:
usesAdapter in interface Persistence
Returns:
false

addToStream

public void addToStream(java.io.ObjectOutputStream out)
                 throws java.io.IOException
Preserve certain fields related to persistence.

Parameters:
out - The feature to be added to the ToStream attribute
Throws:
java.io.IOException

serializedUpdate

public void serializedUpdate(java.io.ObjectInputStream oin)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Get the data that should be preserved when serializing persistent objects.

Parameters:
oin -
Throws:
java.io.IOException
java.lang.ClassNotFoundException

potentialProxyGet

protected java.lang.Object potentialProxyGet(java.lang.reflect.Field adapt)
The value being retrieved may 'change' if it's a proxy. This must be done in a controlled synchronized way.

Parameters:
adapt -
Returns:

accessed

protected boolean accessed(java.lang.reflect.Field f,
                           java.lang.Object[] dataVal,
                           java.lang.Object curValue)
We are accessing Field and the contents of field F may be in a state of flux.

Parameters:
f - The field being accessed.
dataVal -
curValue -
Returns:
boolean If true, then we have changed the instance of the object that should be found in the field.

asNoLongerProxy

protected void asNoLongerProxy(RDBPersistentAdapter target,
                               Persistence source)
Copy the data from the object found in the database into the object that was representing our proxy. Mark the object as no longer being a proxy. This causes several problems with back references and object integrity USE WITH CAUTION.

Parameters:
source - The object that we retrieved from the database.
target - The original object that was once a proxy.

copyFrom

protected void copyFrom(Persistence newObj)
Update the current persistent object with the values from the argument.

Parameters:
newObj -

findMatch

protected AttributeTypeColumn findMatch(AttributeTypeColumn[] types,
                                        Persistence type)
The collection of types may contain a reference to the argument. By looking at the definitions of the types we will attempt to discern which types entry could possibly be referring to the argument type.

Parameters:
types -
type -
Returns:

findColumnMap

public AttributeTypeColumn findColumnMap(java.lang.String path)
                                  throws NotFoundException
From the provided path, find the Attribute type column it represents. Imagine an employee having a person object. Employee has a salary attribute and person has a name attribute. Valid paths for the employee adapter would be 'salary', 'person.name', or 'person'.

Specified by:
findColumnMap in interface RDBPersistence
Parameters:
path -
Returns:
Throws:
NotFoundException