Module org.eclipse.persistence.core
Package org.eclipse.persistence.mappings
Class VariableOneToOneMapping
java.lang.Object
org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,AbstractSession,ContainerPolicy,ClassDescriptor,DatabaseField>
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.ForeignReferenceMapping
org.eclipse.persistence.mappings.ObjectReferenceMapping
org.eclipse.persistence.mappings.VariableOneToOneMapping
- All Implemented Interfaces:
Serializable
,Cloneable
,RelationalMapping
Purpose: Variable one to one mappings are used to represent a pointer references between a java object and an implementer of an interface. This mapping is usually represented by a single pointer (stored in an instance variable) between the source and target objects. In the relational database tables, these mappings are normally implemented using a foreign key and a type code.
- Since:
- TOPLink/Java 2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
protected DatabaseField
protected Map
parallel table typeIndicatorTranslation used prior to initialization to avoid type indicators on Mapping Workbenchprotected Map
Fields inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping
foreignKeyFields, isForeignKeyRelationship
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchFetchType, cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isCascadeOnDeleteSetOnDatabase, isPrivateOwned, joinFetch, mappedBy, NONE, OUTER_JOIN, partitioningPolicy, partitioningPolicyName, QUERY_BATCH_PARAMETER, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassIndicator
(Class<?> implementer, Object typeIndicator) PUBLIC: Add a type indicator conversion to this mapping.void
addClassNameIndicator
(String className, Object typeIndicator) INTERNAL: Add indicators by classname.void
addForeignQueryKeyName
(String sourceForeignKeyFieldName, String targetQueryKeyName) PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping.void
addForeignQueryKeyName
(DatabaseField sourceForeignKeyField, String targetQueryKeyName) PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping.void
addTargetForeignQueryKeyName
(String targetForeignQueryKeyName, String sourcePrimaryKeyFieldName) PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping.protected Object
batchedValueFromRow
(AbstractRecord row, ObjectLevelReadQuery query, CacheKey parentCacheKey) INTERNAL: Possible for future development, not currently supported.clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.protected Vector
INTERNAL: Return all the fields populated by this mapping.protected boolean
compareObjectsWithoutPrivateOwned
(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the references of the two objects are the same, not the objects themselves.void
convertClassNamesToClasses
(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings.INTERNAL: Return the class indicator associations for XML.getDescriptorForTarget
(Object targetObject, AbstractSession session) INTERNAL: Return a descriptor for the target of this mapping For normal ObjectReferenceMappings, we return the reference descriptor.Class
<?> getFieldClassification
(DatabaseField fieldToClassify) INTERNAL: Return the classification for the field contained in the mapping.PUBLIC: Return the foreign key field names associated with the mapping.protected Object
getImplementorForType
(Object type, AbstractSession session) INTERNAL: Return the implementor for a specified typeprotected Object
getPrimaryKeyForObject
(Object object, AbstractSession session) INTERNAL:PUBLIC: Return a collection of the field to query key associations.INTERNAL: Returns the source keys to target keys fields association.PUBLIC: This method returns the name of the typeField of the mapping.protected Object
getTypeForImplementor
(Class<?> implementor) INTERNAL: Return the type for a specified implementorINTERNAL: Return the typeIndicatorName translation Used by the Mapping Workbench to avoid classpath dependenciesINTERNAL: Return the type indicators.void
initialize
(AbstractSession session) INTERNAL: Initialize the mapping.protected void
initializeForeignKeys
(AbstractSession session) INTERNAL: The foreign key names and their primary keys are converted to DatabaseField and stored.void
INTERNAL: Selection criteria is created with source foreign keys and target keys.boolean
INTERNAL:boolean
INTERNAL:void
preInitialize
(AbstractSession session) INTERNAL: Set the type field classification through searching the indicators hashtable.void
rehashFieldDependancies
(AbstractSession session) INTERNAL: Rehash any maps based on fields.void
setClassIndicatorAssociations
(Vector classIndicatorAssociations) PUBLIC: Set the class indicator associations.void
setForeignKeyFieldNames
(Vector fieldNames) PUBLIC: Return the foreign key field names associated with the mapping.void
setForeignQueryKeyName
(String sourceForeignKeyFieldName, String targetQueryKeyName) PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping.void
setSourceToTargetQueryKeyFieldAssociations
(Vector sourceToTargetQueryKeyFieldAssociations) PUBLIC: Set a collection of the source to target query key/field associations.protected void
setSourceToTargetQueryKeyFields
(Map sourceToTargetQueryKeyNames) INTERNAL: Set the source keys to target keys fields association.void
setTypeField
(DatabaseField typeField) INTERNAL: This method set the typeField of the mapping to the parameter fieldvoid
setTypeFieldName
(String typeFieldName) PUBLIC: This method sets the name of the typeField of the mapping.protected void
setTypeIndicatorNameTranslation
(Map translations) INTERNAL: For avoiding classpath dependencies on the Mapping Workbenchprotected void
setTypeIndicatorTranslation
(Map translations) INTERNAL: Set the typeIndicatorTranslations hashtable to the new Hashtable translationsvalueFromObject
(Object object, DatabaseField field, AbstractSession session) INTERNAL: Get a value from the object and set that in the respective field of the row.valueFromRow
(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.protected void
INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeFromObjectIntoRow
(Object object, AbstractRecord record, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeFromObjectIntoRowForShallowInsert
(Object object, AbstractRecord record, AbstractSession session) INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.void
writeFromObjectIntoRowForShallowInsertWithChangeRecord
(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session) INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.void
writeFromObjectIntoRowForUpdateAfterShallowInsert
(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts.void
INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeFromObjectIntoRowWithChangeRecord
(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeInsertFieldsIntoRow
(AbstractRecord record, AbstractSession session) INTERNAL: Write fields needed for insert into the template for with null values.Methods inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildExpression, buildReferencesPKList, buildTargetInterfaces, buildUnitofWorkCloneForPartObject, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, collectQueryParameters, compareForChange, compareObjectsWithPrivateOwned, createCloneValueHolder, earlyPreDelete, extractPrimaryKeyRowForSourceObject, extractPrimaryKeysForReferenceObject, extractPrimaryKeysForReferenceObjectFromRow, extractPrimaryKeysFromRealReferenceObject, fixRealObjectReferences, getForeignKeyFields, getRealAttributeValueFromAttribute, hasConstraintDependency, hasRelationTableMechanism, insert, internalBuildChangeRecord, isChangeTrackingSupported, isForeignKeyRelationship, isObjectReferenceMapping, iterateOnRealAttributeValue, loadAll, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postDelete, postInsert, postUpdate, preDelete, preInsert, preUpdate, readPrivateOwnedForObject, recordPrivateOwnedRemovals, setForeignKeyFields, setIsForeignKeyRelationship, setNewValueInChangeRecord, update, updateChangeRecord, updateChangeRecordForSelfMerge, useProxyIndirection, useProxyIndirection, useProxyIndirection, valueFromPKList, verifyDelete, writeFromObjectIntoRowForUpdate
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addForeignKeyField, addTargetForeignKeyField, buildBackupClone, buildBatchCriteria, buildClone, buildCloneFromRow, checkCacheForBatchKey, compareObjects, dontDoMerge, dontUseBatchReading, dontUseIndirection, executeBatchQuery, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, extractBatchKeyFromRow, extractResultFromBatchQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getMappedBy, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, load, mergeRemoteValueHolder, postPrepareNestedBatchQuery, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, replaceValueHoldersIn, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitialization, valueFromRowInternal, valueFromRowInternal, valueFromRowInternalWithJoin
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cloneFields, convertConverterClassNamesToClasses, derivesId, extractNestedExpressions, extractNestedNonAggregateExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitialize, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeUpdateFieldsIntoRow
-
Field Details
-
typeField
-
sourceToTargetQueryKeyNames
-
typeIndicatorTranslation
-
typeIndicatorNameTranslation
parallel table typeIndicatorTranslation used prior to initialization to avoid type indicators on Mapping Workbench
-
-
Constructor Details
-
VariableOneToOneMapping
public VariableOneToOneMapping()PUBLIC: Default constructor.
-
-
Method Details
-
isRelationalMapping
public boolean isRelationalMapping()INTERNAL:- Overrides:
isRelationalMapping
in classDatabaseMapping
-
addClassIndicator
PUBLIC: Add a type indicator conversion to this mapping. -
addClassNameIndicator
INTERNAL: Add indicators by classname. For use by the Mapping Workbench to avoid classpath dependencies -
addForeignQueryKeyName
PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. This method is used if there are multiple foreign keys. -
addForeignQueryKeyName
PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. This method is used if there are multiple foreign keys. -
addTargetForeignQueryKeyName
public void addTargetForeignQueryKeyName(String targetForeignQueryKeyName, String sourcePrimaryKeyFieldName) PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping. This method is used for composite target foreign key relationships, that is the target object's table has multiple foreign key fields to the source object's primary key fields. Both the target foreign key query name and the source primary key field name must be specified. The distinction between a foreign key and target foreign key is that the variable 1-1 mapping will not populate the target foreign key value when written (because it is in the target table). Normally 1-1's are through foreign keys but in bi-directional 1-1's the back reference will be a target foreign key. In obscure composite legacy data models a 1-1 may consist of a foreign key part and a target foreign key part, in this case both method will be called with the correct parts. -
batchedValueFromRow
protected Object batchedValueFromRow(AbstractRecord row, ObjectLevelReadQuery query, CacheKey parentCacheKey) INTERNAL: Possible for future development, not currently supported. Retrieve the value through using batch reading. This executes a single query to read the target for all of the objects and stores the result of the batch query in the original query to allow the other objects to share the results.- Overrides:
batchedValueFromRow
in classForeignReferenceMapping
-
clone
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.- Overrides:
clone
in classForeignReferenceMapping
- Returns:
- new instance of itself
-
collectFields
INTERNAL: Return all the fields populated by this mapping.- Overrides:
collectFields
in classObjectReferenceMapping
- Returns:
- TODO
-
compareObjectsWithoutPrivateOwned
protected boolean compareObjectsWithoutPrivateOwned(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the references of the two objects are the same, not the objects themselves. Used for independent relationships. This is used for testing and validation purposes. Must get separate fields for the objects because we may be adding a different class to the attribute because of the interface- Overrides:
compareObjectsWithoutPrivateOwned
in classObjectReferenceMapping
-
getClassIndicatorAssociations
INTERNAL: Return the class indicator associations for XML. List of class-name/value associations. -
getDescriptorForTarget
INTERNAL: Return a descriptor for the target of this mapping For normal ObjectReferenceMappings, we return the reference descriptor. For a VariableOneToOneMapping, the reference descriptor is often a descriptor for an interface and does not contain adequate information. As a result, we look up the descriptor for the specific class we are looking for Bug 2612571- Overrides:
getDescriptorForTarget
in classObjectReferenceMapping
- See Also:
-
getFieldClassification
INTERNAL: Return the classification for the field contained in the mapping. This is used to convert the row value to a consistent java value.- Overrides:
getFieldClassification
in classDatabaseMapping
-
getForeignKeyFieldNames
PUBLIC: Return the foreign key field names associated with the mapping. These are only the source fields that are writable. -
getImplementorForType
INTERNAL: Return the implementor for a specified type -
getSourceToTargetQueryKeyFieldAssociations
PUBLIC: Return a collection of the field to query key associations. -
getSourceToTargetQueryKeyNames
INTERNAL: Returns the source keys to target keys fields association. -
getTypeField
-
getTypeFieldName
PUBLIC: This method returns the name of the typeField of the mapping. The type field is used to store the type of object the relationship is referencing. -
getTypeForImplementor
INTERNAL: Return the type for a specified implementor -
getTypeIndicatorTranslation
INTERNAL: Return the type indicators. -
getTypeIndicatorNameTranslation
INTERNAL: Return the typeIndicatorName translation Used by the Mapping Workbench to avoid classpath dependencies -
convertClassNamesToClasses
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.- Overrides:
convertClassNamesToClasses
in classForeignReferenceMapping
- Parameters:
classLoader
- TODO
-
initialize
INTERNAL: Initialize the mapping.- Overrides:
initialize
in classForeignReferenceMapping
-
initializeForeignKeys
INTERNAL: The foreign key names and their primary keys are converted to DatabaseField and stored. -
initializeSelectionCriteria
INTERNAL: Selection criteria is created with source foreign keys and target keys. This criteria is then used to read target records from the table. -
isVariableOneToOneMapping
public boolean isVariableOneToOneMapping()INTERNAL:- Overrides:
isVariableOneToOneMapping
in classDatabaseMapping
-
getPrimaryKeyForObject
INTERNAL:- Overrides:
getPrimaryKeyForObject
in classObjectReferenceMapping
-
preInitialize
INTERNAL: Set the type field classification through searching the indicators hashtable.- Overrides:
preInitialize
in classObjectReferenceMapping
- Throws:
DescriptorException
-
rehashFieldDependancies
INTERNAL: Rehash any maps based on fields. This is used to clone descriptors for aggregates, which hammer field names.- Overrides:
rehashFieldDependancies
in classDatabaseMapping
-
setClassIndicatorAssociations
PUBLIC: Set the class indicator associations. -
setForeignKeyFieldNames
PUBLIC: Return the foreign key field names associated with the mapping. These are only the source fields that are writable. -
setForeignQueryKeyName
PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. This method is used if foreign key is not composite. -
setSourceToTargetQueryKeyFieldAssociations
public void setSourceToTargetQueryKeyFieldAssociations(Vector sourceToTargetQueryKeyFieldAssociations) PUBLIC: Set a collection of the source to target query key/field associations. -
setSourceToTargetQueryKeyFields
INTERNAL: Set the source keys to target keys fields association. -
setTypeField
INTERNAL: This method set the typeField of the mapping to the parameter field -
setTypeFieldName
PUBLIC: This method sets the name of the typeField of the mapping. The type field is used to store the type of object the relationship is referencing. -
setTypeIndicatorTranslation
INTERNAL: Set the typeIndicatorTranslations hashtable to the new Hashtable translations -
setTypeIndicatorNameTranslation
INTERNAL: For avoiding classpath dependencies on the Mapping Workbench -
valueFromObject
INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
valueFromObject
in classDatabaseMapping
- Parameters:
object
- TODOfield
- TODOsession
- TODO- Returns:
- TODO
-
valueFromRow
public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) throws DatabaseException INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object. Check for batch + aggregation reading.- Overrides:
valueFromRow
in classForeignReferenceMapping
- Throws:
DatabaseException
-
writeFromNullObjectIntoRow
INTERNAL: Get a value from the object and set that in the respective field of the row. -
writeFromObjectIntoRow
public void writeFromObjectIntoRow(Object object, AbstractRecord record, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row. If the mapping id target foreign key, you must only write the type into the roe, the rest will be updated when the object itself is written- Overrides:
writeFromObjectIntoRow
in classDatabaseMapping
-
writeFromObjectIntoRowWithChangeRecord
public void writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row. If the mapping id target foreign key, you must only write the type into the roe, the rest will be updated when the object itself is written- Overrides:
writeFromObjectIntoRowWithChangeRecord
in classDatabaseMapping
-
writeFromObjectIntoRowForShallowInsert
public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord record, AbstractSession session) INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.- Overrides:
writeFromObjectIntoRowForShallowInsert
in classDatabaseMapping
-
writeFromObjectIntoRowForUpdateAfterShallowInsert
public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts. It contains the foreign keys with non null values that were set to null for shallow insert. If mapping overrides writeFromObjectIntoRowForShallowInsert method it must override this one, too.- Overrides:
writeFromObjectIntoRowForUpdateAfterShallowInsert
in classDatabaseMapping
-
writeFromObjectIntoRowForShallowInsertWithChangeRecord
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session) INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.- Overrides:
writeFromObjectIntoRowForShallowInsertWithChangeRecord
in classDatabaseMapping
-
writeFromObjectIntoRowForWhereClause
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord record) INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRowForWhereClause
in classObjectReferenceMapping
-
writeInsertFieldsIntoRow
INTERNAL: Write fields needed for insert into the template for with null values.- Overrides:
writeInsertFieldsIntoRow
in classDatabaseMapping
-