com.objectwave.persist
Interface RDBPersistence

All Superinterfaces:
Persistence, java.io.Serializable, TransactionalObjectIF
All Known Implementing Classes:
RDBPersistentAdapter

public interface RDBPersistence
extends Persistence

In order be used with in the RDB supporting framework, all of the following methods must be implemented. Fortunately, most of the work has been done in the RDBPersistentAdapter class, and very little is actually needed to be done by the programmer. The reason that there are some many methods in this class is that it provides a great amount of flexibility in creating the persistence layer. The default behavior will be sufficient for most, however, it may be necessary to change any of the following methods.

Version:
$Id: RDBPersistence.java,v 2.2 2002/02/07 02:44:05 dave_hoag Exp $
Author:
dhoag

Method Summary
 void addCollectionQuery(java.lang.String name, SQLQuery q)
           
 boolean containsAnyChanges()
           
 AttributeTypeColumn findColumnMap(java.lang.String path)
          From the provided path, find the Attribute type column it represents.
 AttributeTypeColumn foreignKeyBackRef(RDBPersistence joinObj)
           
 AttributeTypeColumn foreignKeyJoinColumn(RDBPersistence joinObj, java.lang.reflect.Field specifiedField)
           
 AttributeTypeColumn[] getAttributeDescriptions()
           
 boolean getBrokerGeneratedPrimaryKeys()
           
 java.util.Vector getClassDescription()
           
 AttributeTypeColumn[] getCollectionDescriptions()
           
 java.util.Hashtable getCollectionQueries()
           
 AttributeTypeColumn[] getCollectionTypes(RDBPersistence pRef)
           
 TransactionalObjectIF getDomainObject()
           
 AttributeTypeColumn[] getForeignKeyDescriptions()
           
 AttributeTypeColumn[] getForeignKeyTypes(RDBPersistence refObj)
           
 Persistence getInstance(RDBPersistence refObj, java.lang.String classValue)
           
 AttributeTypeColumn[] getInstanceLinkDescriptions()
           
 AttributeTypeColumn[] getInstanceLinkTypes(RDBPersistence pRef)
           
 Persistence getPersistentObject()
           
 AttributeTypeColumn getPrimaryAttributeDescription()
           
 java.lang.String getPrimaryKeyColumn()
           
 AttributeTypeColumn[] getPrimaryKeyDescriptions()
           
 java.lang.Object getPrimaryKeyField()
          Gets the PrimaryKeyField attribute of the Persistence object
 java.lang.Object[] getPrimaryKeyFields()
          Gets the PrimaryKeyFields attribute of the Persistence object
 int getRecordOffset()
           
 java.lang.String getTableName(java.lang.Object refObj)
           
 AttributeTypeColumn instanceLinkJoinColumn(RDBPersistence joinObj)
           
 boolean isDeleteThis()
           
 boolean isProxy()
           
 void markForDelete()
           
 void setCollectionQueries(java.util.Hashtable t)
           
 void setPrimaryKeyField(java.lang.Object i)
          Sets the PrimaryKeyField attribute of the Persistence object
 void setProxy(boolean b)
           
 void setRecordOffset(int i)
           
 void setSkipScalarCheck(boolean b)
           
 boolean skipScalarCheck()
           
 
Methods inherited from interface com.objectwave.persist.Persistence
delete, getAdapter, getBrokerName, insert, isRetrievedFromDatabase, lock, save, setBrokerName, setRetrievedFromDatabase, unlock, usesAdapter
 
Methods inherited from interface com.objectwave.transactionalSupport.TransactionalObjectIF
getObjectEditor, isDirty, isTransient, setAsTransient, setObjectEditor, update
 

Method Detail

addCollectionQuery

public void addCollectionQuery(java.lang.String name,
                               SQLQuery q)
Parameters:
name -
q -

containsAnyChanges

public boolean containsAnyChanges()
Returns:

foreignKeyBackRef

public AttributeTypeColumn foreignKeyBackRef(RDBPersistence joinObj)
Parameters:
joinObj -
Returns:

getAttributeDescriptions

public AttributeTypeColumn[] getAttributeDescriptions()
Returns:
The AttributeDescriptions value

getBrokerGeneratedPrimaryKeys

public boolean getBrokerGeneratedPrimaryKeys()
Returns:
boolean true if the broker should manage the creation and assignment of the primary key values for persistent objects using this adapter.

getClassDescription

public java.util.Vector getClassDescription()
Returns:
The ClassDescription value

getCollectionDescriptions

public AttributeTypeColumn[] getCollectionDescriptions()
Returns:
The CollectionDescriptions value

getCollectionQueries

public java.util.Hashtable getCollectionQueries()
Returns:
The CollectionQueries value

getCollectionTypes

public AttributeTypeColumn[] getCollectionTypes(RDBPersistence pRef)
Parameters:
pRef -
Returns:
The CollectionTypes value

getDomainObject

public TransactionalObjectIF getDomainObject()
Returns:
TransactionalObject

getForeignKeyDescriptions

public AttributeTypeColumn[] getForeignKeyDescriptions()
Returns:
The ForeignKeyDescriptions value

getPrimaryKeyDescriptions

public AttributeTypeColumn[] getPrimaryKeyDescriptions()
Returns:
The PrimaryKeyDescriptions value

getForeignKeyTypes

public AttributeTypeColumn[] getForeignKeyTypes(RDBPersistence refObj)
Parameters:
refObj -
Returns:
The ForeignKeyTypes value

getInstance

public Persistence getInstance(RDBPersistence refObj,
                               java.lang.String classValue)
                        throws java.lang.InstantiationException,
                               java.lang.IllegalAccessException
Parameters:
refObj -
classValue -
Returns:
The Instance value
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

getInstanceLinkDescriptions

public AttributeTypeColumn[] getInstanceLinkDescriptions()
Returns:
The InstanceLinkDescriptions value

getInstanceLinkTypes

public AttributeTypeColumn[] getInstanceLinkTypes(RDBPersistence pRef)
Parameters:
pRef -
Returns:
The InstanceLinkTypes value

getPersistentObject

public Persistence getPersistentObject()
Returns:
The PersistentObject value

getPrimaryAttributeDescription

public AttributeTypeColumn getPrimaryAttributeDescription()
Returns:
The PrimaryAttributeDescription value

getPrimaryKeyColumn

public java.lang.String getPrimaryKeyColumn()
Returns:
The PrimaryKeyColumn value

getPrimaryKeyField

public java.lang.Object getPrimaryKeyField()
Description copied from interface: Persistence
Gets the PrimaryKeyField attribute of the Persistence object

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

getPrimaryKeyFields

public java.lang.Object[] getPrimaryKeyFields()
Description copied from interface: Persistence
Gets the PrimaryKeyFields attribute of the Persistence object

Specified by:
getPrimaryKeyFields in interface Persistence
Returns:
The PrimaryKeyField values

getRecordOffset

public int getRecordOffset()
Returns:
The RecordOffset value

getTableName

public java.lang.String getTableName(java.lang.Object refObj)
Parameters:
refObj -
Returns:
The TableName value

instanceLinkJoinColumn

public AttributeTypeColumn instanceLinkJoinColumn(RDBPersistence joinObj)
Parameters:
joinObj -
Returns:

foreignKeyJoinColumn

public AttributeTypeColumn foreignKeyJoinColumn(RDBPersistence joinObj,
                                                java.lang.reflect.Field specifiedField)
Parameters:
joinObj -
specifiedField -
Returns:

isDeleteThis

public boolean isDeleteThis()
Returns:
The DeleteThis value

isProxy

public boolean isProxy()
Returns:
The Proxy value

markForDelete

public void markForDelete()
                   throws QueryException
Throws:
QueryException

setCollectionQueries

public void setCollectionQueries(java.util.Hashtable t)
Parameters:
t - The new CollectionQueries value

setPrimaryKeyField

public void setPrimaryKeyField(java.lang.Object i)
Description copied from interface: Persistence
Sets the PrimaryKeyField attribute of the Persistence object

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

setProxy

public void setProxy(boolean b)
Parameters:
b - The new Proxy value

setRecordOffset

public void setRecordOffset(int i)
Parameters:
i - The new RecordOffset value

skipScalarCheck

public boolean skipScalarCheck()
Returns:

setSkipScalarCheck

public void setSkipScalarCheck(boolean b)
Parameters:
b - The new SkipScalarCheck value

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'.

Parameters:
path -
Returns:
Throws:
NotFoundException