public abstract class ObjectReferenceMapping extends ForeignReferenceMapping
Purpose: Abstract class for 1:1, varibale 1:1 and reference mappings
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Vector<DatabaseField> |
foreignKeyFields
Keeps track of which fields are foreign keys on a per field basis (can have mixed foreign key relationships).
|
protected boolean |
isForeignKeyRelationship
Keeps track if any of the fields are foreign keys.
|
cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, hasCustomSelectionQuery, indirectionPolicy, isPrivateOwned, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, selectionQuery, tempInitSessionattributeAccessor, descriptor, fields, isOptional, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, primaryKeyMapping, properties, weight, WEIGHT_1| Modifier | Constructor and Description |
|---|---|
protected |
ObjectReferenceMapping() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
buildBackupCloneForPartObject(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
UnitOfWorkImpl unitOfWork)
INTERNAL:
Used during building the backup shallow copy to copy the vector without re-registering the target objects.
|
ChangeRecord |
buildChangeRecord(java.lang.Object clone,
ObjectChangeSet owner,
AbstractSession session)
INTERNAL:
Directly build a change record without comparison
|
java.lang.Object |
buildCloneForPartObject(java.lang.Object attributeValue,
java.lang.Object original,
java.lang.Object clone,
UnitOfWorkImpl unitOfWork,
boolean isExisting)
INTERNAL:
Require for cloning, the part must be cloned.
|
void |
buildCopy(java.lang.Object copy,
java.lang.Object original,
ObjectCopyingPolicy policy)
INTERNAL:
Copy of the attribute of the object.
|
protected boolean |
cacheKeysAreEqual(CacheKey cacheKey1,
CacheKey cacheKey2)
INTERNAL:
|
void |
cascadePerformRemoveIfRequired(java.lang.Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
void |
cascadeRegisterNewIfRequired(java.lang.Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
protected java.util.Vector<DatabaseField> |
collectFields()
INTERNAL:
Return all the fields populated by this mapping, these are foreign keys only.
|
ChangeRecord |
compareForChange(java.lang.Object clone,
java.lang.Object backUp,
ObjectChangeSet owner,
AbstractSession session)
INTERNAL:
This method was created in VisualAge.
|
protected boolean |
compareObjectsWithoutPrivateOwned(java.lang.Object firstObject,
java.lang.Object secondObject,
AbstractSession session)
INTERNAL:
Compare the references of the two objects are the same, not the objects themselves.
|
protected boolean |
compareObjectsWithPrivateOwned(java.lang.Object firstObject,
java.lang.Object secondObject,
AbstractSession session)
INTERNAL:
Compare the references of the two objects are the same, and the objects themselves are the same.
|
UnitOfWorkValueHolder |
createUnitOfWorkValueHolder(ValueHolderInterface attributeValue,
java.lang.Object original,
java.lang.Object clone,
AbstractRecord row,
UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
INTERNAL:
Builder the unit of work value holder.
|
AbstractRecord |
extractPrimaryKeyRowForSourceObject(java.lang.Object domainObject,
AbstractSession session)
INTERNAL:
Extract the reference pk for rvh usage in remote model.
|
java.util.Vector |
extractPrimaryKeysForReferenceObject(java.lang.Object domainObject,
AbstractSession session)
INTERNAL:
Extract the reference pk for rvh usage in remote model.
|
java.util.Vector |
extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row)
INTERNAL:
Return the primary key for the reference object (i.e.
|
java.util.Vector |
extractPrimaryKeysFromRealReferenceObject(java.lang.Object object,
AbstractSession session)
INTERNAL:
Extract the reference pk for rvh usage in remote model.
|
ClassDescriptor |
getDescriptorForTarget(java.lang.Object object,
AbstractSession session)
INTERNAL:
Return a descriptor for the target of this mapping
|
java.util.Vector<DatabaseField> |
getForeignKeyFields()
INTERNAL:
Returns the foreign key names associated with the mapping.
|
protected java.util.Vector |
getPrimaryKeyForObject(java.lang.Object object,
AbstractSession session)
INTERNAL:
|
java.lang.Object |
getRealAttributeValueFromObject(java.lang.Object object,
AbstractSession session)
INTERNAL:
Object reference must unwrap the reference object if required.
|
boolean |
hasConstraintDependency()
INTERNAL:
The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.
|
protected void |
insert(WriteObjectQuery query)
INTERNAL:
Insert the referenced objects.
|
ObjectReferenceChangeRecord |
internalBuildChangeRecord(java.lang.Object newValue,
ObjectChangeSet owner,
AbstractSession session)
INTERNAL:
Directly build a change record based on the newValue without comparison
|
boolean |
isChangeTrackingSupported()
INTERNAL:
Return if this mapping supports change tracking.
|
boolean |
isForeignKeyRelationship()
INTERNAL:
Return if the 1-1 mapping has a foreign key dependency to its target.
|
boolean |
isObjectReferenceMapping()
INTERNAL:
Related mapping should implement this method to return true.
|
void |
iterateOnRealAttributeValue(DescriptorIterator iterator,
java.lang.Object realAttributeValue)
INTERNAL:
Iterate on the attribute value.
|
void |
mergeChangesIntoObject(java.lang.Object target,
ChangeRecord changeRecord,
java.lang.Object source,
MergeManager mergeManager)
INTERNAL:
Merge changes from the source to the target object.
|
void |
mergeIntoObject(java.lang.Object target,
boolean isTargetUnInitialized,
java.lang.Object source,
MergeManager mergeManager)
INTERNAL:
Merge changes from the source to the target object.
|
void |
postDelete(WriteObjectQuery query)
INTERNAL:
Delete the referenced objects.
|
void |
postInsert(WriteObjectQuery query)
INTERNAL:
Insert privately owned parts
|
void |
postUpdate(WriteObjectQuery query)
INTERNAL:
Update privately owned parts
|
void |
preDelete(WriteObjectQuery query)
INTERNAL:
Delete the referenced objects.
|
void |
preInsert(WriteObjectQuery query)
INTERNAL:
Insert privately owned parts
|
void |
preUpdate(WriteObjectQuery query)
INTERNAL:
Update privately owned parts
|
protected java.lang.Object |
readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery)
INTERNAL:
Reads the private owned object.
|
protected void |
setForeignKeyFields(java.util.Vector<DatabaseField> foreignKeyFields)
INTERNAL:
Set the foreign key fields associated with the mapping.
|
void |
setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
INTERNAL:
Set if the 1-1 mapping has a foreign key dependency to its target.
|
void |
setNewValueInChangeRecord(java.lang.Object newValue,
ObjectReferenceChangeRecord changeRecord,
ObjectChangeSet owner,
AbstractSession session)
INTERNAL:
Set the newValue in the change record
|
protected void |
update(WriteObjectQuery query)
INTERNAL:
Update the private owned part.
|
void |
updateChangeRecord(java.lang.Object clone,
java.lang.Object newValue,
java.lang.Object oldValue,
ObjectChangeSet objectChangeSet,
UnitOfWorkImpl uow)
INTERNAL:
Either create a new change record or update the change record with the new value.
|
boolean |
verifyDelete(java.lang.Object object,
AbstractSession session)
INTERNAL:
To verify if the specified object is deleted or not.
|
void |
writeFromObjectIntoRowForUpdate(WriteObjectQuery query,
AbstractRecord databaseRow)
INTERNAL:
Get a value from the object and set that in the respective field of the row.
|
void |
writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
AbstractRecord databaseRow)
INTERNAL:
Get a value from the object and set that in the respective field of the row.
|
buildBackupClone, buildClone, buildCloneFromRow, clone, compareObjects, convertClassNamesToClasses, dontDoMerge, dontUseIndirection, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getIndirectionPolicy, getJoinCriteria, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, hasCustomSelectionQuery, initialize, initializeReferenceDescriptor, initializeSelectionQuery, isAttributeValueInstantiated, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isPrivateOwned, iterate, prepareHistoricalQuery, prepareNestedJoins, privateOwnedRelationship, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setTempSession, setUsesIndirection, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldObjectModifyCascadeToPartsForPreDelete, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, usesIndirection, useWeavedIndirection, validateBeforeInitialization, valueFromRow, valueFromRowInternal, valueFromRowInternalWithJoinaddToCollectionChangeRecord, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeMerge, cloneFields, extractNestedExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getProperties, getProperty, getRealCollectionAttributeValueFromObject, getReferenceClassDescriptor, getSetMethodName, getWeight, hasDependency, hasInverseConstraintDependency, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCascadedLockingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isJoiningSupported, isManyToManyMapping, isNestedTableMapping, isObjectTypeMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isSerializedObjectMapping, isStructureMapping, isTransformationMapping, isTypeConversionMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postInitialize, preInitialize, prepareCascadeLockingPolicy, readFromRowIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, removeFromCollectionChangeRecord, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDescriptor, setFields, setGetMethodName, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setProperties, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, validateAfterInitialization, valueFromObject, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowDelete, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRowprotected boolean isForeignKeyRelationship
protected java.util.Vector<DatabaseField> foreignKeyFields
public java.lang.Object buildBackupCloneForPartObject(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
UnitOfWorkImpl unitOfWork)
buildBackupCloneForPartObject in class ForeignReferenceMappingpublic java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue,
java.lang.Object original,
java.lang.Object clone,
UnitOfWorkImpl unitOfWork,
boolean isExisting)
buildCloneForPartObject in class ForeignReferenceMappingpublic void buildCopy(java.lang.Object copy,
java.lang.Object original,
ObjectCopyingPolicy policy)
buildCopy in class DatabaseMappingpublic ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backUp, ObjectChangeSet owner, AbstractSession session)
compareForChange in class DatabaseMappingpublic ObjectReferenceChangeRecord internalBuildChangeRecord(java.lang.Object newValue, ObjectChangeSet owner, AbstractSession session)
public void setNewValueInChangeRecord(java.lang.Object newValue,
ObjectReferenceChangeRecord changeRecord,
ObjectChangeSet owner,
AbstractSession session)
protected boolean compareObjectsWithoutPrivateOwned(java.lang.Object firstObject,
java.lang.Object secondObject,
AbstractSession session)
compareObjectsWithoutPrivateOwned in class ForeignReferenceMappingprotected boolean compareObjectsWithPrivateOwned(java.lang.Object firstObject,
java.lang.Object secondObject,
AbstractSession session)
compareObjectsWithPrivateOwned in class ForeignReferenceMappingpublic ClassDescriptor getDescriptorForTarget(java.lang.Object object, AbstractSession session)
Bug 2612571public java.lang.Object getRealAttributeValueFromObject(java.lang.Object object,
AbstractSession session)
getRealAttributeValueFromObject in class ForeignReferenceMappingpublic boolean isObjectReferenceMapping()
isObjectReferenceMapping in class DatabaseMappingpublic void iterateOnRealAttributeValue(DescriptorIterator iterator, java.lang.Object realAttributeValue)
iterateOnRealAttributeValue in class ForeignReferenceMappingpublic void mergeChangesIntoObject(java.lang.Object target,
ChangeRecord changeRecord,
java.lang.Object source,
MergeManager mergeManager)
mergeChangesIntoObject in class DatabaseMappingpublic void mergeIntoObject(java.lang.Object target,
boolean isTargetUnInitialized,
java.lang.Object source,
MergeManager mergeManager)
mergeIntoObject in class DatabaseMappingprotected java.util.Vector<DatabaseField> collectFields()
collectFields in class DatabaseMappingpublic java.util.Vector<DatabaseField> getForeignKeyFields()
protected void setForeignKeyFields(java.util.Vector<DatabaseField> foreignKeyFields)
public boolean isForeignKeyRelationship()
public void setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preInsert in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionprotected java.lang.Object readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery) throws DatabaseException
DatabaseExceptionpublic void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preUpdate in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionpublic void postDelete(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postDelete in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionpublic void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postInsert in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionpublic void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postUpdate in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionpublic void preDelete(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete in class DatabaseMappingDatabaseExceptionOptimisticLockExceptionpublic void cascadePerformRemoveIfRequired(java.lang.Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
cascadePerformRemoveIfRequired in class DatabaseMappingpublic void cascadeRegisterNewIfRequired(java.lang.Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
cascadeRegisterNewIfRequired in class DatabaseMappingprotected boolean cacheKeysAreEqual(CacheKey cacheKey1, CacheKey cacheKey2)
protected java.util.Vector getPrimaryKeyForObject(java.lang.Object object,
AbstractSession session)
public boolean hasConstraintDependency()
hasConstraintDependency in class DatabaseMappingpublic UnitOfWorkValueHolder createUnitOfWorkValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, AbstractRecord row, UnitOfWorkImpl unitOfWork, boolean buildDirectlyFromRow)
createUnitOfWorkValueHolder in class ForeignReferenceMappingbuildDirectlyFromRow - 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.public AbstractRecord extractPrimaryKeyRowForSourceObject(java.lang.Object domainObject, AbstractSession session)
public java.util.Vector extractPrimaryKeysForReferenceObject(java.lang.Object domainObject,
AbstractSession session)
public java.util.Vector extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row)
public java.util.Vector extractPrimaryKeysFromRealReferenceObject(java.lang.Object object,
AbstractSession session)
protected void insert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
protected void update(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
public boolean verifyDelete(java.lang.Object object,
AbstractSession session)
throws DatabaseException
verifyDelete in class DatabaseMappingDatabaseExceptionpublic void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord databaseRow)
writeFromObjectIntoRowForUpdate in class DatabaseMappingpublic void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord databaseRow)
writeFromObjectIntoRowForWhereClause in class DatabaseMappingpublic boolean isChangeTrackingSupported()
isChangeTrackingSupported in class DatabaseMappingpublic void updateChangeRecord(java.lang.Object clone,
java.lang.Object newValue,
java.lang.Object oldValue,
ObjectChangeSet objectChangeSet,
UnitOfWorkImpl uow)
updateChangeRecord in class DatabaseMappingpublic ChangeRecord buildChangeRecord(java.lang.Object clone, ObjectChangeSet owner, AbstractSession session)
buildChangeRecord in class DatabaseMapping