|
EclipseLink1.0 - 20080707 API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.mappings.DatabaseMapping
public abstract class DatabaseMapping
Purpose: Defines how an attribute of an object maps to and from the database
Responsibilities:
Field Summary | |
---|---|
protected AttributeAccessor |
attributeAccessor
Wrapper to store the reference objects. |
protected java.lang.String |
attributeName
PERF: Cache the mappings attribute name. |
protected ClassDescriptor |
descriptor
ClassDescriptor to which this mapping belongs to |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
fields
Fields associated with the mappings are cached |
protected java.lang.Boolean |
isLazy
Specifies whether this mapping is lazy, this means not included in the default fetch group. |
protected boolean |
isOptional
Specifies whether this mapping is optional (i.e. field may be null). |
protected boolean |
isReadOnly
Makes this mapping read only. |
protected boolean |
isRemotelyInitialized
It is needed only in remote initialization and mapping is in parent descriptor |
protected static java.util.Vector |
NO_FIELDS
Used to reduce memory for mappings with no fields. |
protected static java.lang.Integer |
NO_WEIGHT
Used to share integer instance to reduce memory. |
protected boolean |
primaryKeyMapping
PERF: Used as a quick check to see if this mapping is a primary key mapping, set by the object builder during initialization. |
protected java.util.Map |
properties
Allow user defined properties. |
protected java.lang.Integer |
weight
This is a TopLink defined attribute that allows us to sort the mappings |
protected static java.lang.Integer |
WEIGHT_1
|
Constructor Summary | |
---|---|
DatabaseMapping()
PUBLIC: Default constructor. |
Method Summary | |
---|---|
void |
addToCollectionChangeRecord(java.lang.Object newKey,
java.lang.Object newValue,
org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Add a new value and its change set to the collection change record. |
abstract void |
buildBackupClone(java.lang.Object clone,
java.lang.Object backup,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Clone the attribute from the clone and assign it to the backup. |
java.lang.Object |
buildBackupCloneForPartObject(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Require for cloning, the part must be cloned. |
org.eclipse.persistence.internal.sessions.ChangeRecord |
buildChangeRecord(java.lang.Object newValue,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Directly build a change record without comparison |
abstract void |
buildClone(java.lang.Object original,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Clone the attribute from the original and assign it to the clone. |
java.lang.Object |
buildCloneForPartObject(java.lang.Object attributeValue,
java.lang.Object original,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
boolean isExisting)
INTERNAL: Require for cloning, the part must be cloned. |
abstract void |
buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object clone,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: A combination of readFromRowIntoObject and buildClone. |
void |
buildCopy(java.lang.Object copy,
java.lang.Object original,
ObjectCopyingPolicy policy)
INTERNAL: Copy of the attribute of the object. |
Expression |
buildExpression(java.lang.Object queryObject,
QueryByExamplePolicy policy,
Expression expressionBuilder,
java.util.Map processedObjects,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribue and it's value. |
Expression |
buildObjectJoinExpression(Expression base,
Expression argument,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used to allow object level comparisons. |
Expression |
buildObjectJoinExpression(Expression base,
java.lang.Object value,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used to allow object level comparisons. |
void |
buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object original,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Builds a shallow original object. |
void |
calculateDeferredChanges(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as apposed to detected changes. |
void |
cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object,
java.util.Map newObjects,
java.util.Map unregisteredExistingObjects,
java.util.Map visitedObjects,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Cascade discover and persist new objects during commit. |
void |
cascadeMerge(java.lang.Object sourceElement,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Cascade the merge to the component object, if appropriate. |
abstract void |
cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade |
abstract void |
cascadeRegisterNewIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade |
java.lang.Object |
clone()
INTERNAL: Clones itself. |
protected java.util.Vector |
cloneFields(java.util.Vector fields)
INTERNAL: Helper method to clone vector of fields (used in aggregate initialization cloning). |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
collectFields()
This method must be overwritten in the subclasses to return a vector of all the fields this mapping represents. |
abstract org.eclipse.persistence.internal.sessions.ChangeRecord |
compareForChange(java.lang.Object clone,
java.lang.Object backup,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This method was created in VisualAge. |
abstract boolean |
compareObjects(java.lang.Object firstObject,
java.lang.Object secondObject,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the attributes belonging to this mapping for the objects. |
void |
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary. |
org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder |
createUnitOfWorkValueHolder(ValueHolderInterface attributeValue,
java.lang.Object original,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
INTERNAL: Builder the unit of work value holder. |
protected java.util.Vector |
extractNestedExpressions(java.util.List expressions,
ExpressionBuilder newRoot,
boolean rootExpressionsAllowed)
INTERNAL: Extract the nested attribute expressions that apply to this mapping. |
abstract void |
fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
RemoteSession session)
INTERNAL: An object has been serialized from the server to the client. |
void |
fixRealObjectReferences(java.lang.Object object,
java.util.Map objectInformation,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
RemoteSession session)
INTERNAL: At this point, we realize we don't have indirection; so we need to replace the reference object(s) with the corresponding object(s) from the remote session. |
AttributeAccessor |
getAttributeAccessor()
ADVANCED: Return the attributeAccessor. |
java.lang.Class |
getAttributeClassification()
PUBLIC: The classification type for the attribute this mapping represents |
java.lang.String |
getAttributeName()
PUBLIC: Return the name of the attribute set in the mapping. |
java.lang.Object |
getAttributeValueFromObject(java.lang.Object object)
INTERNAL: Return the value of an attribute which this mapping represents for an object. |
org.eclipse.persistence.internal.queries.ContainerPolicy |
getContainerPolicy()
INTERNAL: Return the mapping's containerPolicy. |
ClassDescriptor |
getDescriptor()
INTERNAL: Return the descriptor to which this mapping belongs |
org.eclipse.persistence.internal.helper.DatabaseField |
getField()
INTERNAL: Return the field associated with this mapping if there is exactly one. |
java.lang.Class |
getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classifiction for the field contained in the mapping. |
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getFields()
INTERNAL: Returns a vector of all the fields this mapping represents. |
java.lang.String |
getGetMethodName()
PUBLIC: This method is invoked reflectively on the reference object to return the value of the attribute in the object. |
java.lang.Object |
getObjectCorrespondingTo(java.lang.Object object,
RemoteSession session,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query)
INTERNAL: return the object on the client corresponding to the specified object. |
java.util.Map |
getProperties()
INTERNAL: used as a temporary store for custom SDK usage |
java.lang.Object |
getProperty(java.lang.Object property)
ADVANCED: Allow user defined properties. |
java.lang.Object |
getRealAttributeValueFromObject(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return the value of an attribute unwrapping value holders if required. |
java.lang.Object |
getRealCollectionAttributeValueFromObject(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return the value of an attribute, unwrapping value holders if necessary. |
ClassDescriptor |
getReferenceDescriptor()
PUBLIC: Return the referenceDescriptor. |
DatabaseMapping |
getRelationshipPartner()
INTERNAL: Return the relationshipPartner mapping for this bi-directional mapping. |
java.util.Vector |
getSelectFields()
INTERNAL: Returns the set of fields that should be selected to build this mapping's value(s). |
java.util.Vector |
getSelectTables()
INTERNAL: Returns the table(s) that should be selected to build this mapping's value(s). |
java.lang.String |
getSetMethodName()
PUBLIC: This method is invoked reflectively on the reference object to set the value of the attribute in the object. |
java.lang.Object |
getValueFromRemoteValueHolder(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
INTERNAL: extract and return the appropriate value from the specified remote value holder |
java.lang.Integer |
getWeight()
INTERNAL: Return the weight of the mapping, used to sort mappings to ensure that DirectToField Mappings get merged first |
boolean |
hasConstraintDependency()
INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables. |
boolean |
hasDependency()
INTERNAL: Return if the mapping has any ownership or other dependency over its target object(s). |
boolean |
hasInverseConstraintDependency()
INTERNAL: The returns if the mapping has any inverse constraint dependencies, such as foreign keys and join tables. |
protected boolean |
hasRootExpressionThatShouldUseOuterJoin(java.util.List expressions)
INTERNAL: If there is root expression in the list then indicates whether it shouldUseOuterJoin, otherwise return false. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow for initialization of properties and validation. |
void |
instantiateAttribute(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Trigger the instantiation of the attribute if lazy. |
boolean |
isAbstractCompositeCollectionMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isAbstractCompositeDirectCollectionMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isAbstractCompositeObjectMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isAbstractDirectMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isAggregateCollectionMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isAggregateMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isAggregateObjectMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isCascadedLockingSupported()
INTERNAL: Used when determining if a mapping supports cascaded version optimistic locking. |
boolean |
isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking. |
boolean |
isCloningRequired()
INTERNAL: Return if this mapping requires its attribute value to be cloned. |
boolean |
isCollectionMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isDatabaseMapping()
INTERNAL: |
boolean |
isDirectCollectionMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isDirectMapMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isDirectToFieldMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isDirectToXMLTypeMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isEISMapping()
INTERNAL: All EIS mappings should implement this method to return true. |
boolean |
isForeignReferenceMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isJoiningSupported()
INTERNAL: Return if this mapping support joining. |
boolean |
isLazy()
Return if this mapping is lazy. |
boolean |
isManyToManyMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isNestedTableMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isObjectReferenceMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isOneToManyMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isOneToOneMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isOptional()
Return whether the value of this mapping is optional (that is, can be null). |
boolean |
isPrimaryKeyMapping()
INTERNAL: Set by the Object builder during initialization returns true if this mapping is used as a primary key mapping. |
boolean |
isPrivateOwned()
INTERNAL: Return if the mapping has ownership over its target object(s). |
boolean |
isReadOnly()
INTERNAL: Returns true if mapping is read only else false. |
boolean |
isReferenceMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isRelationalMapping()
INTERNAL: All relational mappings should implement this method to return true. |
protected boolean |
isRemotelyInitialized()
|
boolean |
isStructureMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isTransformationMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isUsingMethodAccess()
PUBLIC: Return if method access is used. |
boolean |
isVariableOneToOneMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isWriteOnly()
INTERNAL: Some mappings support no attribute (transformation). |
boolean |
isXMLMapping()
INTERNAL: All relational mappings should implement this method to return true. |
abstract void |
iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
INTERNAL: Iterate on the appropriate attribute value. |
void |
iterateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
java.lang.Object realAttributeValue)
INTERNAL: Iterate on the attribute value. |
abstract void |
mergeChangesIntoObject(java.lang.Object target,
org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
java.lang.Object source,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object. |
abstract void |
mergeIntoObject(java.lang.Object target,
boolean isTargetUninitialized,
java.lang.Object source,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object. |
void |
performDataModificationEvent(java.lang.Object[] event,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Perform the commit event. |
void |
postDelete(DeleteObjectQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow for initialization of properties and validation that have dependecies no the descriptor being initialized. |
void |
postInsert(WriteObjectQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
postUpdate(WriteObjectQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
preDelete(DeleteObjectQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow for initialization of properties and validation. |
void |
preInsert(WriteObjectQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
prepareCascadeLockingPolicy()
INTERNAL: A subclass that supports cascade version optimistic locking should implement this method to properly prepare the locking policy for their mapping type. |
void |
preUpdate(WriteObjectQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
java.lang.Object |
readFromResultSetIntoObject(java.sql.ResultSet resultSet,
java.lang.Object targetObject,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor,
java.sql.ResultSetMetaData metaData,
int columnNumber,
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform)
INTERNAL: Extract values directly from the result-set. |
java.lang.Object |
readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object targetObject,
ObjectBuildingQuery sourceQuery)
INTERNAL: Extract value from the row and set the attribute to this value in the object. |
java.lang.Object |
readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object targetObject,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Extract value from the row and set the attribute to this value in the object. |
void |
readOnly()
PUBLIC: To make mapping read only. |
void |
readWrite()
PUBLIC: The mapping can be dynamically made either readOnly or readWriteOnly. |
void |
rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Rehash any hashtables based on fields. |
void |
remoteInitialization(DistributedSession session)
INTERNAL: Once descriptors are serialized to the remote session. |
protected void |
remotelyInitialized()
Set the mapping to be initialized for the remote session. |
void |
removeFromCollectionChangeRecord(java.lang.Object newKey,
java.lang.Object newValue,
org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Remove a value and its change set from the collection change record. |
java.util.Map |
replaceValueHoldersIn(java.lang.Object object,
org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)
INTERNAL: replace the value holders in the specified reference object(s) |
void |
setAttributeAccessor(AttributeAccessor attributeAccessor)
ADVANCED: Set the attributeAccessor. |
void |
setAttributeName(java.lang.String attributeName)
PUBLIC: Sets the name of the attribute in the mapping. |
void |
setAttributeValueInObject(java.lang.Object object,
java.lang.Object value)
INTERNAL: Set the value of the attribute mapped by this mapping. |
void |
setChangeListener(java.lang.Object clone,
java.beans.PropertyChangeListener listener,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Set the change listener if required. |
void |
setDescriptor(ClassDescriptor descriptor)
INTERNAL: Set the descriptor to which this mapping belongs |
protected void |
setFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> fields)
INTERNAL: Set the mapping's field collection. |
void |
setGetMethodName(java.lang.String methodName)
PUBLIC: This method is invoked reflectively on the reference object to return the value of the attribute in the object. |
void |
setIsLazy(boolean isLazy)
Set if this mapping is lazy. |
void |
setIsOptional(boolean isOptional)
Used to specify whether the value of this mapping may be null. |
void |
setIsPrimaryKeyMapping(boolean pkMapping)
INTERNAL: Set by the Object builder during initialization returns true if this mapping is used as a primary key mapping. |
void |
setIsReadOnly(boolean aBoolean)
PUBLIC: Set this mapping to be read only. |
void |
setProperties(java.util.Map properties)
INTERNAL: Allow user defined properties. |
void |
setProperty(java.lang.Object property,
java.lang.Object value)
ADVANCED: Allow user defined properties. |
void |
setRealAttributeValueInObject(java.lang.Object object,
java.lang.Object value)
INTERNAL: Set the value of the attribute mapped by this mapping, placing it inside a value holder if necessary. |
void |
setSetMethodName(java.lang.String methodName)
PUBLIC: Set the methodName used to set the value for the mapping's attribute into the object. |
void |
setWeight(java.lang.Integer newWeight)
ADVANCED: Set the weight of the mapping, used to sort mappings DirectToField Mappings have a default weight of 1 while all other Mappings have a default weight of MAXINT. |
void |
simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
java.lang.Object changeSetToAdd,
org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
org.eclipse.persistence.internal.sessions.AbstractSession session)
ADVANCED: This method is used to add an object to a collection once the changeSet is applied. |
void |
simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
java.lang.Object changeSetToAdd,
org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
org.eclipse.persistence.internal.sessions.AbstractSession session)
ADVANCED: This method is used to remove an object from a collection once the changeSet is applied. |
java.lang.String |
toString()
INTERNAL: Print the mapping attribute name, this is used in error messages. |
void |
updateChangeRecord(java.lang.Object clone,
java.lang.Object newValue,
java.lang.Object oldValue,
org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Either create a new change record or update the change record with the new value. |
void |
validateAfterInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow for subclasses to perform validation. |
void |
validateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow for subclasses to perform validation. |
java.lang.Object |
valueFromObject(java.lang.Object anObject,
org.eclipse.persistence.internal.helper.DatabaseField field,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: A subclass should extract the value from the object for the field, if it does not map the field then it should return null. |
java.lang.Object |
valueFromResultSet(java.sql.ResultSet resultSet,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor,
java.sql.ResultSetMetaData metaData,
int columnNumber,
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform)
INTERNAL: Returns the value for the mapping directly from the result-set. |
java.lang.Object |
valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query)
INTERNAL: A subclass should implement this method if it wants different behavior. |
java.lang.Object |
valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: A subclass should implement this method if it wants different behavior. |
boolean |
verifyDelete(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: To verify if the specified object has been deleted or not. |
void |
writeFromAttributeIntoRow(java.lang.Object attribute,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
writeFromObjectIntoRow(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. |
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. |
void |
writeFromObjectIntoRowForUpdate(WriteObjectQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Write the attribute value from the object to the row for update. |
void |
writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: A subclass should implement this method if it wants different behavior. |
void |
writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values. |
void |
writeUpdateFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for update into the template for with null values. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.util.Vector NO_FIELDS
protected static final java.lang.Integer NO_WEIGHT
protected static final java.lang.Integer WEIGHT_1
protected ClassDescriptor descriptor
protected AttributeAccessor attributeAccessor
protected boolean isReadOnly
protected boolean isOptional
protected java.lang.Boolean isLazy
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> fields
protected boolean isRemotelyInitialized
protected java.lang.Integer weight
protected java.util.Map properties
protected boolean primaryKeyMapping
protected java.lang.String attributeName
Constructor Detail |
---|
public DatabaseMapping()
Method Detail |
---|
public abstract void buildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
public java.lang.Object buildBackupCloneForPartObject(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
public abstract void buildClone(java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
public abstract void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
buildClone assumes the attribute value exists on the original and can simply be copied.
readFromRowIntoObject assumes that one is building an original.
Both of the above assumptions are false in this method, and actually attempts to do both at the same time.
Extract value from the row and set the attribute to this value in the working copy clone. In order to bypass the shared cache when in transaction a UnitOfWork must be able to populate working copies directly from the row.
public void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
public java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
public void buildCopy(java.lang.Object copy, java.lang.Object original, ObjectCopyingPolicy policy)
public Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
public Expression buildObjectJoinExpression(Expression base, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
public Expression buildObjectJoinExpression(Expression base, Expression argument, org.eclipse.persistence.internal.sessions.AbstractSession session)
public abstract void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
public abstract void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
public void calculateDeferredChanges(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void cascadeMerge(java.lang.Object sourceElement, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
public java.lang.Object clone()
clone
in class java.lang.Object
protected java.util.Vector cloneFields(java.util.Vector fields)
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> collectFields()
public abstract org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
public abstract boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
classLoader
- public org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder createUnitOfWorkValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean buildDirectlyFromRow)
buildDirectlyFromRow
- indicates that we are building the clone directly
from a row as opposed to building the original from the row, putting it in
the shared cache, and then cloning the original.protected java.util.Vector extractNestedExpressions(java.util.List expressions, ExpressionBuilder newRoot, boolean rootExpressionsAllowed)
rootExpressionsAllowed
- true if newRoot itself can be one of the
expressions returnedprotected boolean hasRootExpressionThatShouldUseOuterJoin(java.util.List expressions)
public abstract void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
public void fixRealObjectReferences(java.lang.Object object, java.util.Map objectInformation, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
public AttributeAccessor getAttributeAccessor()
public java.lang.Class getAttributeClassification()
public java.lang.String getAttributeName()
public java.lang.Object getAttributeValueFromObject(java.lang.Object object) throws DescriptorException
DescriptorException
public org.eclipse.persistence.internal.queries.ContainerPolicy getContainerPolicy()
public ClassDescriptor getDescriptor()
public org.eclipse.persistence.internal.helper.DatabaseField getField()
public java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
public java.util.Vector getSelectFields()
public java.util.Vector getSelectTables()
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getFields()
public java.lang.String getGetMethodName()
public java.lang.Object getObjectCorrespondingTo(java.lang.Object object, RemoteSession session, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)
public java.util.Map getProperties()
public java.lang.Object getProperty(java.lang.Object property)
public java.lang.Object getRealAttributeValueFromObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public void instantiateAttribute(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.lang.Object getRealCollectionAttributeValueFromObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public ClassDescriptor getReferenceDescriptor()
public DatabaseMapping getRelationshipPartner()
public java.lang.String getSetMethodName()
public java.lang.Object getValueFromRemoteValueHolder(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
public java.lang.Integer getWeight()
public boolean hasConstraintDependency()
public boolean isUsingMethodAccess()
public boolean hasDependency()
public boolean hasInverseConstraintDependency()
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public boolean isAggregateCollectionMapping()
public boolean isAggregateMapping()
public boolean isAggregateObjectMapping()
public boolean isCollectionMapping()
public boolean isDatabaseMapping()
public boolean isDirectCollectionMapping()
public boolean isDirectMapMapping()
public boolean isDirectToFieldMapping()
public boolean isForeignReferenceMapping()
public boolean isManyToManyMapping()
public boolean isNestedTableMapping()
public boolean isObjectReferenceMapping()
public boolean isOneToManyMapping()
public boolean isOneToOneMapping()
public boolean isOptional()
public boolean isLazy()
For relationship mappings this should normally be the same value as indirection, however for eager relationships this can be used with indirection to allow indirection locking and change tracking, but still always force instantiation.
public void setIsLazy(boolean isLazy)
public boolean isEISMapping()
public boolean isRelationalMapping()
public boolean isXMLMapping()
public boolean isAbstractDirectMapping()
public boolean isAbstractCompositeDirectCollectionMapping()
public boolean isAbstractCompositeObjectMapping()
public boolean isAbstractCompositeCollectionMapping()
public boolean isJoiningSupported()
public boolean isCloningRequired()
public boolean isPrimaryKeyMapping()
public boolean isCascadedLockingSupported()
public boolean isChangeTrackingSupported(Project project)
public boolean isPrivateOwned()
public boolean isReadOnly()
public boolean isReferenceMapping()
protected boolean isRemotelyInitialized()
public boolean isStructureMapping()
public boolean isTransformationMapping()
public boolean isVariableOneToOneMapping()
public boolean isDirectToXMLTypeMapping()
public boolean isWriteOnly()
public abstract void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
public void iterateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)
public abstract void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
public abstract void mergeIntoObject(java.lang.Object target, boolean isTargetUninitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
public void performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException, DescriptorException
DatabaseException
DescriptorException
public void postDelete(DeleteObjectQuery query) throws DatabaseException
DatabaseException
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public void postInsert(WriteObjectQuery query) throws DatabaseException
DatabaseException
public void postUpdate(WriteObjectQuery query) throws DatabaseException
DatabaseException
public void preDelete(DeleteObjectQuery query) throws DatabaseException
DatabaseException
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public void preInsert(WriteObjectQuery query) throws DatabaseException
DatabaseException
public void prepareCascadeLockingPolicy()
public void preUpdate(WriteObjectQuery query) throws DatabaseException
DatabaseException
public java.lang.Object readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object targetObject, ObjectBuildingQuery sourceQuery) throws DatabaseException
DatabaseException
public java.lang.Object readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object targetObject, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession) throws DatabaseException
DatabaseException
public java.lang.Object readFromResultSetIntoObject(java.sql.ResultSet resultSet, java.lang.Object targetObject, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, java.sql.ResultSetMetaData metaData, int columnNumber, org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform) throws DatabaseException
DatabaseException
public void readOnly()
public void readWrite()
public void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
public void remoteInitialization(DistributedSession session)
protected void remotelyInitialized()
public java.util.Map replaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)
public void setAttributeAccessor(AttributeAccessor attributeAccessor)
public void setAttributeName(java.lang.String attributeName)
public void setAttributeValueInObject(java.lang.Object object, java.lang.Object value) throws DescriptorException
DescriptorException
public void setRealAttributeValueInObject(java.lang.Object object, java.lang.Object value) throws DescriptorException
DescriptorException
public void setDescriptor(ClassDescriptor descriptor)
protected void setFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> fields)
public void setGetMethodName(java.lang.String methodName)
public void setIsOptional(boolean isOptional)
public void setIsPrimaryKeyMapping(boolean pkMapping)
public void setIsReadOnly(boolean aBoolean)
public void setProperties(java.util.Map properties)
public void setProperty(java.lang.Object property, java.lang.Object value)
public void setSetMethodName(java.lang.String methodName)
public void setWeight(java.lang.Integer newWeight)
public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public java.lang.String toString()
toString
in class java.lang.Object
public void validateAfterInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public void validateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public java.lang.Object valueFromObject(java.lang.Object anObject, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query) throws DatabaseException
DatabaseException
public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
DatabaseException
public java.lang.Object valueFromResultSet(java.sql.ResultSet resultSet, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, java.sql.ResultSetMetaData metaData, int columnNumber, org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform) throws DatabaseException
DatabaseException
public boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
DatabaseException
public void writeFromAttributeIntoRow(java.lang.Object attribute, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void writeFromObjectIntoRowForShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row)
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row)
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void writeUpdateFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void updateChangeRecord(java.lang.Object clone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow) throws DescriptorException
DescriptorException
public void setChangeListener(java.lang.Object clone, java.beans.PropertyChangeListener listener, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
public void addToCollectionChangeRecord(java.lang.Object newKey, java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow) throws DescriptorException
DescriptorException
public void removeFromCollectionChangeRecord(java.lang.Object newKey, java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow) throws DescriptorException
DescriptorException
public org.eclipse.persistence.internal.sessions.ChangeRecord buildChangeRecord(java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
|
EclipseLink1.0 - 20080707 API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |