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 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, tempInitSession
attributeAccessor, 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 |
---|---|
Object |
buildBackupCloneForPartObject(Object attributeValue,
Object clone,
Object backup,
UnitOfWorkImpl unitOfWork)
INTERNAL:
Used during building the backup shallow copy to copy the vector without re-registering the target objects.
|
ChangeRecord |
buildChangeRecord(Object clone,
ObjectChangeSet owner,
AbstractSession session)
INTERNAL:
Directly build a change record without comparison
|
Object |
buildCloneForPartObject(Object attributeValue,
Object original,
Object clone,
UnitOfWorkImpl unitOfWork,
boolean isExisting)
INTERNAL:
Require for cloning, the part must be cloned.
|
void |
buildCopy(Object copy,
Object original,
ObjectCopyingPolicy policy)
INTERNAL:
Copy of the attribute of the object.
|
protected boolean |
cacheKeysAreEqual(CacheKey cacheKey1,
CacheKey cacheKey2)
INTERNAL:
|
void |
cascadePerformRemoveIfRequired(Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
void |
cascadeRegisterNewIfRequired(Object object,
UnitOfWorkImpl uow,
IdentityHashtable visitedObjects)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
protected Vector<DatabaseField> |
collectFields()
INTERNAL:
Return all the fields populated by this mapping, these are foreign keys only.
|
ChangeRecord |
compareForChange(Object clone,
Object backUp,
ObjectChangeSet owner,
AbstractSession session)
INTERNAL:
This method was created in VisualAge.
|
protected boolean |
compareObjectsWithoutPrivateOwned(Object firstObject,
Object secondObject,
AbstractSession session)
INTERNAL:
Compare the references of the two objects are the same, not the objects themselves.
|
protected boolean |
compareObjectsWithPrivateOwned(Object firstObject,
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,
Object original,
Object clone,
AbstractRecord row,
UnitOfWorkImpl unitOfWork,
boolean buildDirectlyFromRow)
INTERNAL:
Builder the unit of work value holder.
|
AbstractRecord |
extractPrimaryKeyRowForSourceObject(Object domainObject,
AbstractSession session)
INTERNAL:
Extract the reference pk for rvh usage in remote model.
|
Vector |
extractPrimaryKeysForReferenceObject(Object domainObject,
AbstractSession session)
INTERNAL:
Extract the reference pk for rvh usage in remote model.
|
Vector |
extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row)
INTERNAL:
Return the primary key for the reference object (i.e.
|
Vector |
extractPrimaryKeysFromRealReferenceObject(Object object,
AbstractSession session)
INTERNAL:
Extract the reference pk for rvh usage in remote model.
|
ClassDescriptor |
getDescriptorForTarget(Object object,
AbstractSession session)
INTERNAL:
Return a descriptor for the target of this mapping
|
Vector<DatabaseField> |
getForeignKeyFields()
INTERNAL:
Returns the foreign key names associated with the mapping.
|
protected Vector |
getPrimaryKeyForObject(Object object,
AbstractSession session)
INTERNAL:
|
Object |
getRealAttributeValueFromObject(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(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,
Object realAttributeValue)
INTERNAL:
Iterate on the attribute value.
|
void |
mergeChangesIntoObject(Object target,
ChangeRecord changeRecord,
Object source,
MergeManager mergeManager)
INTERNAL:
Merge changes from the source to the target object.
|
void |
mergeIntoObject(Object target,
boolean isTargetUnInitialized,
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 Object |
readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery)
INTERNAL:
Reads the private owned object.
|
protected void |
setForeignKeyFields(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(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(Object clone,
Object newValue,
Object oldValue,
ObjectChangeSet objectChangeSet,
UnitOfWorkImpl uow)
INTERNAL:
Either create a new change record or update the change record with the new value.
|
boolean |
verifyDelete(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, valueFromRowInternalWithJoin
addToCollectionChangeRecord, 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, writeUpdateFieldsIntoRow
protected boolean isForeignKeyRelationship
protected Vector<DatabaseField> foreignKeyFields
public Object buildBackupCloneForPartObject(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork)
buildBackupCloneForPartObject
in class ForeignReferenceMapping
public Object buildCloneForPartObject(Object attributeValue, Object original, Object clone, UnitOfWorkImpl unitOfWork, boolean isExisting)
buildCloneForPartObject
in class ForeignReferenceMapping
public void buildCopy(Object copy, Object original, ObjectCopyingPolicy policy)
buildCopy
in class DatabaseMapping
public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session)
compareForChange
in class DatabaseMapping
public ObjectReferenceChangeRecord internalBuildChangeRecord(Object newValue, ObjectChangeSet owner, AbstractSession session)
public void setNewValueInChangeRecord(Object newValue, ObjectReferenceChangeRecord changeRecord, ObjectChangeSet owner, AbstractSession session)
protected boolean compareObjectsWithoutPrivateOwned(Object firstObject, Object secondObject, AbstractSession session)
compareObjectsWithoutPrivateOwned
in class ForeignReferenceMapping
protected boolean compareObjectsWithPrivateOwned(Object firstObject, Object secondObject, AbstractSession session)
compareObjectsWithPrivateOwned
in class ForeignReferenceMapping
public ClassDescriptor getDescriptorForTarget(Object object, AbstractSession session)
Bug 2612571
public Object getRealAttributeValueFromObject(Object object, AbstractSession session)
getRealAttributeValueFromObject
in class ForeignReferenceMapping
public boolean isObjectReferenceMapping()
isObjectReferenceMapping
in class DatabaseMapping
public void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue)
iterateOnRealAttributeValue
in class ForeignReferenceMapping
public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager)
mergeChangesIntoObject
in class DatabaseMapping
public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager)
mergeIntoObject
in class DatabaseMapping
protected Vector<DatabaseField> collectFields()
collectFields
in class DatabaseMapping
public Vector<DatabaseField> getForeignKeyFields()
protected void setForeignKeyFields(Vector<DatabaseField> foreignKeyFields)
public boolean isForeignKeyRelationship()
public void setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preInsert
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected Object readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery) throws DatabaseException
DatabaseException
public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preUpdate
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void postDelete(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postDelete
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postInsert
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postUpdate
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void preDelete(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void cascadePerformRemoveIfRequired(Object object, UnitOfWorkImpl uow, IdentityHashtable visitedObjects)
cascadePerformRemoveIfRequired
in class DatabaseMapping
public void cascadeRegisterNewIfRequired(Object object, UnitOfWorkImpl uow, IdentityHashtable visitedObjects)
cascadeRegisterNewIfRequired
in class DatabaseMapping
protected boolean cacheKeysAreEqual(CacheKey cacheKey1, CacheKey cacheKey2)
protected Vector getPrimaryKeyForObject(Object object, AbstractSession session)
public boolean hasConstraintDependency()
hasConstraintDependency
in class DatabaseMapping
public UnitOfWorkValueHolder createUnitOfWorkValueHolder(ValueHolderInterface attributeValue, Object original, Object clone, AbstractRecord row, UnitOfWorkImpl unitOfWork, boolean buildDirectlyFromRow)
createUnitOfWorkValueHolder
in class ForeignReferenceMapping
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.public AbstractRecord extractPrimaryKeyRowForSourceObject(Object domainObject, AbstractSession session)
public Vector extractPrimaryKeysForReferenceObject(Object domainObject, AbstractSession session)
public Vector extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row)
public Vector extractPrimaryKeysFromRealReferenceObject(Object object, AbstractSession session)
protected void insert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
protected void update(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
public boolean verifyDelete(Object object, AbstractSession session) throws DatabaseException
verifyDelete
in class DatabaseMapping
DatabaseException
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord databaseRow)
writeFromObjectIntoRowForUpdate
in class DatabaseMapping
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord databaseRow)
writeFromObjectIntoRowForWhereClause
in class DatabaseMapping
public boolean isChangeTrackingSupported()
isChangeTrackingSupported
in class DatabaseMapping
public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow)
updateChangeRecord
in class DatabaseMapping
public ChangeRecord buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session)
buildChangeRecord
in class DatabaseMapping
Copyright © 2024. All rights reserved.