com.objectwave.persist.mapping
Class RDBExtendablePersistentAdapter

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

public class RDBExtendablePersistentAdapter
extends RDBPersistentAdapter

Designed to support sharing multiple heterogeneous objects in a single database table.

Version:
$Id: RDBExtendablePersistentAdapter.java,v 2.0 2001/06/11 16:00:04 dave_hoag Exp $
Author:
Steve Sinclair
See Also:
RDBBroker, Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.objectwave.persist.mapping.RDBPersistentAdapter
RDBPersistentAdapter.Test
 
Nested classes inherited from class com.objectwave.transactionalSupport.ObjectEditor
ObjectEditor.Test
 
Field Summary
 
Fields inherited from class com.objectwave.persist.mapping.RDBPersistentAdapter
brokerGeneratedPrimaryKeys, mi
 
Fields inherited from class com.objectwave.transactionalSupport.ObjectEditor
dataExchange, fds, security
 
Constructor Summary
RDBExtendablePersistentAdapter(Persistence p)
          Constructor:
RDBExtendablePersistentAdapter(Persistence p, java.lang.String brokerName)
          Constructor:
 
Method Summary
 Persistence createInstance(RDBPersistence refObj, RDBPersistence origObj, java.lang.Object typeId)
          Extensions of this class will probably want to override this method to return Persistence objects of a given type.
 Persistence getInstance(RDBPersistence refObj, java.lang.String classValue)
          This method must be extended by the custom implementation to return an instance of the correct type.
 java.lang.Object getTypeId()
           
 AttributeTypeColumn getTypeIdentifierDescription()
          A special type that defines the data that is to be used to determine what type of object a database row is representing.
 
Methods inherited from class com.objectwave.persist.mapping.RDBPersistentAdapter
accessed, addCollectionQuery, addToStream, asNoLongerProxy, basicNew, containsAttributeChanges, copyFrom, delete, equals, findColumnMap, findMatch, foreignKeyBackRef, foreignKeyJoinColumn, foreignKeyJoinData, get, getAdapter, getAttributeDescriptions, getBrokerGeneratedPrimaryKeys, getBrokerName, getClassDescription, getCollectionDescriptions, getCollectionQueries, getCollectionTypes, getForeignKeyDescriptions, getForeignKeyTypes, getInstanceLinkDescriptions, getInstanceLinkTypes, getObjectEditor, getPersistentObject, getPrimaryAttributeDescription, getPrimaryKeyColumn, getPrimaryKeyDescriptions, getPrimaryKeyField, getPrimaryKeyFields, getRecordOffset, getTableName, hashCode, insert, instanceLinkJoinColumn, instanceLinkJoinColumns, isDeleteThis, isProxy, isRetrievedFromDatabase, markForDelete, potentialProxyGet, realizeProxy, save, serializedUpdate, set, setBrokerGeneratedPrimaryKeys, setBrokerName, setClassDescription, setCollectionQueries, setCustomData, setObjectEditor, setPrimaryKeyField, setProxy, setRecordOffset, setRetrievedFromDatabase, setSkipScalarCheck, setTableName, setValue, skipScalarCheck, update, usesAdapter
 
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
 

Constructor Detail

RDBExtendablePersistentAdapter

public RDBExtendablePersistentAdapter(Persistence p)
Constructor:

Parameters:
p -

RDBExtendablePersistentAdapter

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

Parameters:
p -
brokerName -
Method Detail

getInstance

public Persistence getInstance(RDBPersistence refObj,
                               java.lang.String classValue)
                        throws java.lang.InstantiationException,
                               java.lang.IllegalAccessException
This method must be extended by the custom implementation to return an instance of the correct type. It is up to the developer defining the RDBExtendablePersistent object to interpert the 'classValue' parameter and return a Persistent object of the correct type.

Specified by:
getInstance in interface RDBPersistence
Overrides:
getInstance in class RDBPersistentAdapter
Parameters:
classValue - java.lang.String The value found in the database as defined by the TypeAtt in the database map.
refObj -
Returns:
Persistence Either the one created through the default mechanism, or one defined
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

getTypeId

public java.lang.Object getTypeId()
Returns:
java.lang.Object

getTypeIdentifierDescription

public AttributeTypeColumn getTypeIdentifierDescription()
A special type that defines the data that is to be used to determine what type of object a database row is representing.

Returns:
com.objectwave.persist.AttributeTypeColumn

createInstance

public Persistence createInstance(RDBPersistence refObj,
                                  RDBPersistence origObj,
                                  java.lang.Object typeId)
Extensions of this class will probably want to override this method to return Persistence objects of a given type. The generated object should be based on the value of the typeId parameter, which is the value for the TYPEATT-typed column in the database row that we are creating an object for. If this method is not overridden, then there is no effect in using extendable persistence.

Parameters:
refObj - com.objectwave.persist.RDBPersistence
typeId - java.lang.Object
origObj -
Returns:
com.objectwave.persist.Persistence