|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.mappings.DatabaseMapping org.eclipse.persistence.mappings.AggregateMapping org.eclipse.persistence.mappings.AggregateObjectMapping
public class AggregateObjectMapping
Purpose:Two objects can be considered to be related by aggregation if there is a strict 1:1 relationship between the objects. This means that the target (child or owned) object cannot exist without the source (parent) object. In TopLink, it also means the data for the owned object is stored in the same table as the parent.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
---|
DatabaseMapping.WriteType |
Field Summary | |
---|---|
protected org.eclipse.persistence.internal.helper.DatabaseTable |
aggregateKeyTable
|
protected java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> |
aggregateToSourceFields
322233 - changed to store the source DatabaseField to hold Case and other colunm info |
protected boolean |
isNullAllowed
If all the fields in the database row for the aggregate object are NULL, then, by default, the mapping will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
protected java.util.List<DatabaseMapping> |
mapsIdMappings
List of maps id mappings that need to be set to read only at initialize time on their cloned aggregate mappings. |
protected java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> |
nestedFieldTranslations
Map of nested attributes that need to apply an override name to their a nested aggregate mapping's database field. |
protected java.util.List<ManyToManyMapping> |
overrideManyToManyMappings
List of many to many mapping overrides to apply at initialize time to their cloned aggregate mappings. |
protected java.util.List<UnidirectionalOneToManyMapping> |
overrideUnidirectionalOneToManyMappings
List of unidirectional one to many mapping overrides to apply at initialize time to their cloned aggregate mappings. |
Fields inherited from class org.eclipse.persistence.mappings.AggregateMapping |
---|
referenceClass, referenceClassName, referenceDescriptor |
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
---|
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM |
Constructor Summary | |
---|---|
AggregateObjectMapping()
Default constructor. |
Method Summary | |
---|---|
void |
addAdditionalFieldsToQuery(ReadQuery selectionQuery,
Expression baseExpression)
INTERNAL: Used when initializing queries for mappings that use a Map Called when the selection query is being initialized to add the fields for the map key to the query |
void |
addFieldNameTranslation(java.lang.String sourceFieldName,
java.lang.String aggregateFieldName)
PUBLIC: Add a field name translation that maps from a field name in the source table to a field name in the aggregate descriptor. |
void |
addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
INTERNAL: Used when initializing queries for mappings that use a Map Called when the insert query is being initialized to ensure the fields for the map key are in the insert query |
void |
addFieldTranslation(org.eclipse.persistence.internal.helper.DatabaseField sourceField,
java.lang.String aggregateFieldName)
PUBLIC: Add a field translation that maps from a field in the source table to a field name in the aggregate descriptor. |
void |
addKeyToDeletedObjectsList(java.lang.Object object,
java.util.Map deletedObjects)
INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy. |
void |
addMapsIdMapping(DatabaseMapping mapping)
INTERNAL: In JPA users may specify a maps id mapping on a shared embeddable descriptor. |
void |
addNestedFieldTranslation(java.lang.String attributeName,
org.eclipse.persistence.internal.helper.DatabaseField sourceField,
java.lang.String aggregateFieldName)
INTERNAL: Add a nested field translation that maps from a field in the source table to a field name in a nested aggregate descriptor. |
void |
addOverrideManyToManyMapping(ManyToManyMapping mapping)
INTERNAL: In JPA users may specify overrides to apply to a many to many mapping on a shared embeddable descriptor. |
void |
addOverrideUnidirectionalOneToManyMapping(UnidirectionalOneToManyMapping mapping)
INTERNAL: In JPA users may specify overrides to apply to a unidirectional one to many mapping on a shared embeddable descriptor. |
void |
addPrimaryKeyJoinField(org.eclipse.persistence.internal.helper.DatabaseField primaryKeyField,
org.eclipse.persistence.internal.helper.DatabaseField secondaryField)
INTERNAL: Add a primary key join column (secondary field). |
protected boolean |
allAggregateFieldsAreNull(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
INTERNAL: Return whether all the aggregate fields in the specified row are NULL. |
void |
allowNull()
PUBLIC: If all the fields in the database row for the aggregate object are NULL, then, by default, the mapping will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
protected boolean |
backupAttributeValueIsNull(WriteObjectQuery query)
INTERNAL: Return whether the query's backup object has an attribute value of null. |
java.lang.Object |
buildAggregateFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object targetObject,
org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
boolean buildShallowOriginal,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession,
boolean targetIsProtected)
INTERNAL: Build and return an aggregate object from the specified row. |
void |
buildClone(java.lang.Object original,
org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
INTERNAL: Clone the attribute from the original and assign it to the clone. |
void |
buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object clone,
org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: A combination of readFromRowIntoObject and buildClone. |
java.lang.Object |
buildElementClone(java.lang.Object attributeValue,
java.lang.Object parent,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
org.eclipse.persistence.internal.sessions.AbstractSession cloningSession,
boolean isExisting)
INTERNAL: Build a clone of the given element in a unitOfWork |
Expression |
buildObjectJoinExpression(Expression expression,
Expression argument,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used to allow object level comparisons. |
Expression |
buildObjectJoinExpression(Expression expression,
java.lang.Object value,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used to allow object level comparisons. |
ReadQuery |
buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Certain key mappings favor different types of selection query. |
void |
buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object original,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Builds a shallow original object. |
protected org.eclipse.persistence.internal.sessions.AbstractRecord |
buildTemplateInsertRow(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build and return a "template" database row with all the fields set to null. |
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,
boolean getAttributeValueFromObject)
INTERNAL: Cascade discover and persist new objects during commit to the map key |
void |
cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL: Cascade perform delete through mappings that require the cascade |
void |
cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects,
boolean getAttributeValueFromObject)
INTERNAL: Cascade perform delete through mappings that require the cascade |
void |
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet |
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 |
void |
cascadeRegisterNewIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects,
boolean getAttributeValueFromObject)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade |
java.lang.Object |
clone()
INTERNAL: Clone the aggregate to source field names. |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
collectFields()
INTERNAL: Return the fields handled by the mapping. |
void |
collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> record)
INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entity |
java.lang.Object |
createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManger,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
org.eclipse.persistence.internal.sessions.AbstractSession session,
boolean isTargetProtected)
INTERNAL Called when a DatabaseMapping is used to map the key in a collection and a join query is executed. |
java.lang.Object |
createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
org.eclipse.persistence.internal.sessions.AbstractSession session,
boolean isTargetProtected)
INTERNAL Called when a DatabaseMapping is used to map the key in a collection. |
java.lang.Object |
createMapComponentFromSerializableKeyInfo(java.lang.Object keyInfo,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Create an instance of the Key object from the key information extracted from the map. |
QueryKey |
createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key |
java.lang.Object |
createSerializableMapKeyInfo(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Creates the Array of simple types used to recreate this map. |
void |
deleteMapKey(java.lang.Object objectDeleted,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy, Delete the passed object if necessary. |
void |
dontAllowNull()
PUBLIC: If all the fields in the database row for the aggregate object are NULL, then, by default, the mapping will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
java.util.Map |
extractIdentityFieldsForQuery(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the fields for the Map key from the object to use in a query. |
Expression |
getAdditionalSelectionCriteriaForMapKey()
INTERNAL: Return the selection criteria necessary to select the target object when this mapping is a map key. |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable> |
getAdditionalTablesForJoinQuery()
INTERNAL: Return any tables that will be required when this mapping is used as part of a join query |
java.util.Vector<Association> |
getAggregateToSourceFieldAssociations()
INTERNAL: Return a collection of the aggregate to source field associations. |
java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> |
getAggregateToSourceFields()
INTERNAL: Return the hashtable that stores aggregate field name to source fields. |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getAllFieldsForMapKey()
INTERNAL: Get all the fields for the map key |
java.lang.Class |
getAttributeClassification()
PUBLIC: The classification type for the attribute this mapping represents |
java.lang.Class |
getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classification for the field contained in the mapping. |
java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
getForeignKeyFieldsForMapKey()
INTERNAL: Return a Map of any foreign keys defined within the the MapKey |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getIdentityFieldsForMapKey()
INTERNAL: Return the fields that make up the identity of the mapped object. |
java.lang.Object |
getMapKeyTargetType()
INTERNAL: Return the class this key mapping maps or the descriptor for it |
protected java.lang.Object |
getMatchingAttributeValueFromObject(org.eclipse.persistence.internal.sessions.AbstractRecord row,
java.lang.Object targetObject,
org.eclipse.persistence.internal.sessions.AbstractSession session,
ClassDescriptor descriptor)
INTERNAL: This is used to preserve object identity during a refreshObject() query. |
protected java.lang.Object |
getMatchingBackupAttributeValue(WriteObjectQuery query,
java.lang.Object attributeValue)
INTERNAL: This is used to match up objects during an update in a UOW. |
ObjectLevelReadQuery |
getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectLevelReadQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return the query that is used when this mapping is part of a joined relationship This method is used when this mapping is used to map the key in a Map |
ClassDescriptor |
getReferenceDescriptor(java.lang.Class theClass,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Since aggregate object mappings clone their descriptors, for inheritance the correct child clone must be found. |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getReferenceFields()
INTERNAL: Return the fields used to build the aggregate object. |
java.lang.Object |
getTargetVersionOfSourceObject(java.lang.Object object,
java.lang.Object parent,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager,
org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
INTERNAL: If required, get the targetVersion of the source object from the merge manager. |
boolean |
hasDependency()
INTERNAL: Return if the mapping has any ownership or other dependency over its target object(s). |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: For an aggregate mapping the reference descriptor is cloned. |
void |
initializeChildInheritance(ClassDescriptor parentDescriptor,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: For an aggregate mapping the reference descriptor is cloned. |
void |
initializeParentInheritance(ClassDescriptor parentDescriptor,
ClassDescriptor childDescriptor,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: For an aggregate mapping the reference descriptor is cloned. |
protected void |
initializeReferenceDescriptor(ClassDescriptor clonedDescriptor)
INTERNAL: Initialize the cloned reference descriptor with table names and primary keys |
boolean |
isAggregateObjectMapping()
INTERNAL: Related mapping should implement this method to return true. |
boolean |
isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking. |
boolean |
isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking. |
boolean |
isLockableMapping()
INTERNAL: Return whether this mapping should be traversed when we are locking |
boolean |
isNullAllowed()
PUBLIC: Return if all the fields in the database row for the aggregate object are NULL, then, by default, the mapping will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
boolean |
isRelationalMapping()
INTERNAL: |
void |
iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
java.lang.Object element)
INTERNAL: Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey |
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: For an aggregate mapping the reference descriptor is cloned. |
void |
postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)
INTERNAL: Making any mapping changes necessary to use a the mapping as a map key after initializing the mapping. |
void |
preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: Making any mapping changes necessary to use a the mapping as a map key prior to initializing the mapping |
java.lang.Object |
readFromReturnRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord row,
java.lang.Object targetObject,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
ReadObjectQuery query,
java.util.Collection handledMappings)
INTERNAL: Build an aggregate object from the specified return row and put it in the specified target object. |
java.lang.Object |
readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object targetObject,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession,
boolean isTargetProtected)
INTERNAL: Build an aggregate object from the specified row and put it in the specified target object. |
void |
rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Rehash any hashtables based on fields. |
boolean |
requiresDataModificationEventsForMapKey()
INTERNAL: Return whether this mapping requires extra queries to update the rows if it is used as a key in a map. |
void |
setAggregateToSourceFieldAssociations(java.util.Vector<Association> fieldAssociations)
INTERNAL: Set a collection of the aggregate to source field name associations. |
void |
setAggregateToSourceFields(java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> aggregateToSource)
INTERNAL: Set the hashtable that stores target field name to the source field name. |
void |
setChangeListener(java.lang.Object clone,
java.beans.PropertyChangeListener listener,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Set the change listener in the aggregate. |
void |
setIsNullAllowed(boolean isNullAllowed)
PUBLIC: Configure if all the fields in the database row for the aggregate object are NULL, then, by default, the mapping will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
void |
setTableForAggregateMappingKey(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: If this mapping is used as the key of a CollectionTableMapMapping, the table used by this mapping will be the relation table. |
protected void |
translateField(org.eclipse.persistence.internal.helper.DatabaseField sourceField,
org.eclipse.persistence.internal.helper.DatabaseField mappingField,
ClassDescriptor clonedDescriptor)
INTERNAL: Apply the field translation from the sourceField to the mappingField. |
protected void |
translateFields(ClassDescriptor clonedDescriptor,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: If field names are different in the source and aggregate objects then the translation is done here. |
java.lang.Object |
unwrapKey(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the key mapping to unwrap the object |
java.lang.Object |
valueFromObject(java.lang.Object object,
org.eclipse.persistence.internal.helper.DatabaseField field,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract value of the field from the object |
java.lang.Object |
wrapKey(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the key mapping to wrap the object |
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 databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row. |
void |
writeFromObjectIntoRowForUpdate(WriteObjectQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
INTERNAL: Get the attribute value from the object and add the changed values to the specified database row. |
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row. |
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. |
protected void |
writeNullReferenceRow(org.eclipse.persistence.internal.sessions.AbstractRecord record)
INTERNAL: Write null values for all aggregate fields into the parent row. |
protected void |
writeToRowFromAggregate(org.eclipse.persistence.internal.sessions.AbstractRecord record,
java.lang.Object object,
java.lang.Object attributeValue,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL: Write the aggregate values into the parent row. |
protected void |
writeToRowFromAggregateForUpdate(org.eclipse.persistence.internal.sessions.AbstractRecord record,
WriteObjectQuery query,
java.lang.Object attributeValue)
INTERNAL: Build and return a database row built with the changed values from the specified attribute value. |
protected void |
writeToRowFromAggregateWithChangeRecord(org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL: Build and return a database row built with the values from the specified attribute value. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.persistence.mappings.foundation.MapKeyMapping |
---|
getReferenceDescriptor |
Methods inherited from interface org.eclipse.persistence.mappings.EmbeddableMapping |
---|
getAttributeName |
Field Detail |
---|
protected boolean isNullAllowed
protected org.eclipse.persistence.internal.helper.DatabaseTable aggregateKeyTable
protected transient java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> aggregateToSourceFields
protected transient java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> nestedFieldTranslations
addFieldTranslation()
protected transient java.util.List<ManyToManyMapping> overrideManyToManyMappings
protected transient java.util.List<UnidirectionalOneToManyMapping> overrideUnidirectionalOneToManyMappings
protected transient java.util.List<DatabaseMapping> mapsIdMappings
Constructor Detail |
---|
public AggregateObjectMapping()
Method Detail |
---|
public boolean isRelationalMapping()
isRelationalMapping
in class DatabaseMapping
public void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
addAdditionalFieldsToQuery
in interface MapKeyMapping
public void addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
addFieldsForMapKey
in interface MapKeyMapping
public void addFieldNameTranslation(java.lang.String sourceFieldName, java.lang.String aggregateFieldName)
public void addFieldTranslation(org.eclipse.persistence.internal.helper.DatabaseField sourceField, java.lang.String aggregateFieldName)
addFieldTranslation
in interface EmbeddableMapping
public void addMapsIdMapping(DatabaseMapping mapping)
public void addNestedFieldTranslation(java.lang.String attributeName, org.eclipse.persistence.internal.helper.DatabaseField sourceField, java.lang.String aggregateFieldName)
addNestedFieldTranslation
in interface EmbeddableMapping
public void addOverrideManyToManyMapping(ManyToManyMapping mapping)
addOverrideManyToManyMapping
in interface EmbeddableMapping
public void addOverrideUnidirectionalOneToManyMapping(UnidirectionalOneToManyMapping mapping)
addOverrideUnidirectionalOneToManyMapping
in interface EmbeddableMapping
public void addKeyToDeletedObjectsList(java.lang.Object object, java.util.Map deletedObjects)
addKeyToDeletedObjectsList
in interface MapKeyMapping
object
- manager
- protected boolean allAggregateFieldsAreNull(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
public void allowNull()
protected boolean backupAttributeValueIsNull(WriteObjectQuery query)
public java.lang.Object buildAggregateFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, java.lang.Object targetObject, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, boolean buildShallowOriginal, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean targetIsProtected) throws DatabaseException
DatabaseException
protected void writeNullReferenceRow(org.eclipse.persistence.internal.sessions.AbstractRecord record)
public Expression buildObjectJoinExpression(Expression expression, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildObjectJoinExpression
in class DatabaseMapping
public Expression buildObjectJoinExpression(Expression expression, Expression argument, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildObjectJoinExpression
in class DatabaseMapping
protected void writeToRowFromAggregate(org.eclipse.persistence.internal.sessions.AbstractRecord record, java.lang.Object object, java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) throws DescriptorException
DescriptorException
protected void writeToRowFromAggregateWithChangeRecord(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) throws DescriptorException
DescriptorException
protected void writeToRowFromAggregateForUpdate(org.eclipse.persistence.internal.sessions.AbstractRecord record, WriteObjectQuery query, java.lang.Object attributeValue) throws DescriptorException
DescriptorException
public void buildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
buildClone
in class AggregateMapping
public java.lang.Object buildElementClone(java.lang.Object attributeValue, java.lang.Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting)
buildElementClone
in interface MapKeyMapping
element
- cloningSession
- isExisting
-
public void setChangeListener(java.lang.Object clone, java.beans.PropertyChangeListener listener, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
setChangeListener
in class DatabaseMapping
public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, 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.
buildCloneFromRow
in class AggregateMapping
public void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
buildShallowOriginalFromRow
in class DatabaseMapping
public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
buildSelectionQueryForDirectCollectionKeyMapping
in interface MapKeyMapping
protected org.eclipse.persistence.internal.sessions.AbstractRecord buildTemplateInsertRow(org.eclipse.persistence.internal.sessions.AbstractSession session)
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, boolean getAttributeValueFromObject)
cascadeDiscoverAndPersistUnregisteredNewObjects
in interface MapKeyMapping
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)
cascadePerformRemoveIfRequired
in interface MapKeyMapping
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
cascadePerformRemoveIfRequired
in class DatabaseMapping
public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired
in class DatabaseMapping
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)
cascadeRegisterNewIfRequired
in interface MapKeyMapping
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
cascadeRegisterNewIfRequired
in class DatabaseMapping
public java.lang.Object clone()
clone
in class DatabaseMapping
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> collectFields()
collectFields
in class DatabaseMapping
public void collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> record)
collectQueryParameters
in class DatabaseMapping
public java.lang.Object createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)
createMapComponentFromRow
in interface MapComponentMapping
public java.lang.Object createSerializableMapKeyInfo(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
createSerializableMapKeyInfo
in interface MapKeyMapping
public java.lang.Object createMapComponentFromSerializableKeyInfo(java.lang.Object keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)
createMapComponentFromSerializableKeyInfo
in interface MapKeyMapping
public java.lang.Object createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManger, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)
createMapComponentFromJoinedRow
in interface MapKeyMapping
public QueryKey createQueryKeyForMapKey()
createQueryKeyForMapKey
in interface MapKeyMapping
public void deleteMapKey(java.lang.Object objectDeleted, org.eclipse.persistence.internal.sessions.AbstractSession session)
deleteMapKey
in interface MapKeyMapping
objectDeleted
- session
- public void dontAllowNull()
public java.util.Map extractIdentityFieldsForQuery(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
extractIdentityFieldsForQuery
in interface MapKeyMapping
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable> getAdditionalTablesForJoinQuery()
getAdditionalTablesForJoinQuery
in interface MapKeyMapping
public Expression getAdditionalSelectionCriteriaForMapKey()
getAdditionalSelectionCriteriaForMapKey
in interface MapKeyMapping
public java.util.Vector<Association> getAggregateToSourceFieldAssociations()
public java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> getAggregateToSourceFields()
public java.lang.Class getAttributeClassification()
getAttributeClassification
in class DatabaseMapping
public java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
getFieldClassification
in class DatabaseMapping
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getIdentityFieldsForMapKey()
getIdentityFieldsForMapKey
in interface MapKeyMapping
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAllFieldsForMapKey()
getAllFieldsForMapKey
in interface MapKeyMapping
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getForeignKeyFieldsForMapKey()
getForeignKeyFieldsForMapKey
in interface MapKeyMapping
protected java.lang.Object getMatchingAttributeValueFromObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, java.lang.Object targetObject, org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor descriptor)
protected java.lang.Object getMatchingBackupAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue)
public ObjectLevelReadQuery getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectLevelReadQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
getNestedJoinQuery
in interface MapKeyMapping
public ClassDescriptor getReferenceDescriptor(java.lang.Class theClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
getReferenceDescriptor
in class AggregateMapping
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getReferenceFields()
public java.lang.Object getTargetVersionOfSourceObject(java.lang.Object object, java.lang.Object parent, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
getTargetVersionOfSourceObject
in interface MapKeyMapping
public java.lang.Object getMapKeyTargetType()
getMapKeyTargetType
in interface MapKeyMapping
public boolean hasDependency()
hasDependency
in class DatabaseMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class AggregateMapping
DescriptorException
public void initializeChildInheritance(ClassDescriptor parentDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
public void initializeParentInheritance(ClassDescriptor parentDescriptor, ClassDescriptor childDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
DescriptorException
protected void initializeReferenceDescriptor(ClassDescriptor clonedDescriptor)
public void iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)
iterateOnMapKey
in interface MapKeyMapping
iterator
- element
- public boolean isLockableMapping()
isLockableMapping
in class DatabaseMapping
public boolean isAggregateObjectMapping()
isAggregateObjectMapping
in class DatabaseMapping
public boolean isChangeTrackingSupported(Project project)
isChangeTrackingSupported
in class DatabaseMapping
public boolean isCascadedLockingSupported()
isCascadedLockingSupported
in class DatabaseMapping
public boolean isNullAllowed()
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
postInitialize
in class DatabaseMapping
DescriptorException
public void preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table)
preinitializeMapKey
in interface MapKeyMapping
public void postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)
postInitializeMapKey
in interface MapKeyMapping
public java.lang.Object readFromReturnRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, java.lang.Object targetObject, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, ReadObjectQuery query, java.util.Collection handledMappings) 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, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected) throws DatabaseException
readFromRowIntoObject
in class DatabaseMapping
DatabaseException
public void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
rehashFieldDependancies
in class DatabaseMapping
public boolean requiresDataModificationEventsForMapKey()
requiresDataModificationEventsForMapKey
in interface MapKeyMapping
public void setAggregateToSourceFieldAssociations(java.util.Vector<Association> fieldAssociations)
public void setAggregateToSourceFields(java.util.Map<java.lang.String,org.eclipse.persistence.internal.helper.DatabaseField> aggregateToSource)
public void setIsNullAllowed(boolean isNullAllowed)
public void setTableForAggregateMappingKey(org.eclipse.persistence.internal.helper.DatabaseTable table)
protected void translateField(org.eclipse.persistence.internal.helper.DatabaseField sourceField, org.eclipse.persistence.internal.helper.DatabaseField mappingField, ClassDescriptor clonedDescriptor)
protected void translateFields(ClassDescriptor clonedDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.lang.Object unwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
unwrapKey
in interface MapKeyMapping
key
- session
-
public java.lang.Object wrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
wrapKey
in interface MapKeyMapping
key
- session
-
public void writeFromAttributeIntoRow(java.lang.Object attribute, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromAttributeIntoRow
in class DatabaseMapping
public java.lang.Object valueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
valueFromObject
in class DatabaseMapping
DescriptorException
public void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) throws DescriptorException
writeFromObjectIntoRow
in class DatabaseMapping
DescriptorException
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) throws DescriptorException
writeFromObjectIntoRowWithChangeRecord
in class DatabaseMapping
DescriptorException
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow) throws DescriptorException
writeFromObjectIntoRowForUpdate
in class DatabaseMapping
DescriptorException
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
writeInsertFieldsIntoRow
in class DatabaseMapping
public void addPrimaryKeyJoinField(org.eclipse.persistence.internal.helper.DatabaseField primaryKeyField, org.eclipse.persistence.internal.helper.DatabaseField secondaryField)
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |