|
EclipseLink 1.1.4, build 'v20100812-r7860' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.ForeignReferenceMapping
org.eclipse.persistence.mappings.CollectionMapping
org.eclipse.persistence.mappings.OneToManyMapping
org.eclipse.persistence.mappings.UnidirectionalOneToManyMapping
public class UnidirectionalOneToManyMapping
Purpose: UnidirectionalOneToManyMapping doesn't have 1:1 back reference mapping.
Field Summary | |
---|---|
protected DataModifyQuery |
addTargetQuery
Query used to update a single target row setting its foreign key to point to the source. |
protected boolean |
hasCustomAddTargetQuery
|
protected boolean |
hasCustomPreDeleteQuery
|
protected boolean |
hasCustomRemoveAllTargetsQuery
|
protected boolean |
hasCustomRemoveTargetQuery
|
protected static java.lang.String |
ObjectAdded
|
protected static java.lang.String |
ObjectRemoved
|
protected static java.lang.String |
PostInsert
Used for data modification events. |
protected DataModifyQuery |
preDeleteQuery
Query used to update all target rows before the source object is deleted. |
protected DataModifyQuery |
removeAllTargetsQuery
Query used to update all target rows changing target foreign key value from the one pointing to the source to null. |
protected DataModifyQuery |
removeTargetQuery
Query used to update a single target row changing its foreign key value from the one pointing to the source to null. |
protected boolean |
shouldIncrementTargetLockValueOnAddOrRemoveTarget
Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source. |
protected boolean |
shouldIncrementTargetLockValueOnDeleteSource
Indicates whether target's optimistic locking value should be incremented on the source deletion. |
Fields inherited from class org.eclipse.persistence.mappings.OneToManyMapping |
---|
sourceKeyFields, sourceKeysToTargetForeignKeys, targetForeignKeyFields, targetForeignKeysToSourceKeys |
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping |
---|
containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy |
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping |
---|
cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession, usesBatchReading |
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
---|
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1 |
Constructor Summary | |
---|---|
UnidirectionalOneToManyMapping()
PUBLIC: Default constructor. |
Method Summary | |
---|---|
org.eclipse.persistence.internal.sessions.ChangeRecord |
compareForChange(java.lang.Object clone,
java.lang.Object backUp,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This method is used to create a change record from comparing two collections |
protected java.util.Vector |
extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the primary key value from the source row. |
java.lang.Object |
extractResultFromBatchQuery(DatabaseQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
INTERNAL: Extract the value from the batch optimized query. |
protected java.util.Vector |
extractSourceKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the source primary key value from the target row. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mapping. |
protected void |
initializeAddTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize addTargetQuery. |
protected void |
initializeRemoveAllTargetsQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize removeAllTargetsQuery. |
protected void |
initializeRemoveTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize removeTargetQuery. |
boolean |
isUnidirectionalOneToManyMapping()
INTERNAL: |
protected void |
objectAddedDuringUpdate(ObjectLevelModifyQuery query,
java.lang.Object objectAdded,
org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet)
INTERNAL: An object was added to the collection during an update, insert it if private. |
protected void |
objectRemovedDuringUpdate(ObjectLevelModifyQuery query,
java.lang.Object objectDeleted)
INTERNAL: An object was removed to the collection during an update, delete it if private. |
void |
performDataModificationEvent(java.lang.Object[] event,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Perform the commit event. |
void |
postCalculateChanges(ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated. |
void |
postCalculateChangesOnDeleted(java.lang.Object deletedObject,
org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet uowChangeSet,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Overridden by mappings that require objects to be deleted contribute to change set creation. |
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize the type of the target foreign key, as it will be null as it is not mapped in the target. |
void |
postInsert(WriteObjectQuery query)
INTERNAL: Insert target foreign key into the reference table. |
protected void |
postPrepareNestedBatchQuery(ReadQuery batchQuery,
ReadAllQuery query)
INTERNAL: Add additional fields |
void |
postUpdate(WriteObjectQuery query)
INTERNAL: Update the relation table with the entries related to this mapping. |
void |
preDelete(DeleteObjectQuery query)
INTERNAL: Delete the reference objects. |
void |
prepareCascadeLockingPolicy()
Prepare a cascade locking policy. |
protected void |
prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key. |
void |
setAddTargetSQLString(java.lang.String sqlString)
PUBLIC: |
void |
setCustomAddTargetQuery(DataModifyQuery query)
PUBLIC: The default add target query for mapping can be overridden by specifying the new query. |
void |
setCustomRemoveAllTargetsQuery(DataModifyQuery query)
PUBLIC: The default remove all targets query for mapping can be overridden by specifying the new query. |
void |
setCustomRemoveTargetQuery(DataModifyQuery query)
PUBLIC: The default remove target query for mapping can be overridden by specifying the new query. |
void |
setSessionName(java.lang.String name)
PUBLIC: Set the name of the session to execute the mapping's queries under. |
void |
setShouldIncrementTargetLockValueOnAddOrRemoveTarget(boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget)
PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true). |
void |
setShouldIncrementTargetLockValueOnDeleteSource(boolean shouldIncrementTargetLockValueOnDeleteSource)
PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true). |
boolean |
shouldIncrementTargetLockValueOnAddOrRemoveTarget()
PUBLIC: Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true). |
boolean |
shouldIncrementTargetLockValueOnDeleteSource()
PUBLIC: Indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true). |
void |
updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query,
java.lang.Object objectAdded)
INTERNAL: Update target foreign key after a target object was added to the source. |
void |
updateTargetForeignKeyPostUpdateSource_ObjectRemoved(ObjectLevelModifyQuery query,
java.lang.Object objectRemoved)
INTERNAL: Update target foreign key after a target object was removed from the source. |
void |
updateTargetForeignKeyPreDeleteSource(ObjectLevelModifyQuery query)
INTERNAL: Update target foreign key after a target object was removed from the source. |
void |
updateTargetForeignKeysPostInsertSource(WriteObjectQuery query)
INTERNAL: Update target foreign keys after a new source was inserted. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String PostInsert
protected static final java.lang.String ObjectRemoved
protected static final java.lang.String ObjectAdded
protected transient DataModifyQuery preDeleteQuery
protected transient boolean hasCustomPreDeleteQuery
protected transient DataModifyQuery addTargetQuery
protected transient boolean hasCustomAddTargetQuery
protected transient DataModifyQuery removeTargetQuery
protected transient boolean hasCustomRemoveTargetQuery
protected transient DataModifyQuery removeAllTargetsQuery
protected transient boolean hasCustomRemoveAllTargetsQuery
protected transient boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget
protected transient boolean shouldIncrementTargetLockValueOnDeleteSource
Constructor Detail |
---|
public UnidirectionalOneToManyMapping()
Method Detail |
---|
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
compareForChange
in class CollectionMapping
protected java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
protected java.util.Vector extractSourceKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.lang.Object extractResultFromBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
extractResultFromBatchQuery
in class OneToManyMapping
public boolean isUnidirectionalOneToManyMapping()
isUnidirectionalOneToManyMapping
in class DatabaseMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class OneToManyMapping
DescriptorException
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
postInitialize
in class DatabaseMapping
protected void initializeAddTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeRemoveTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeRemoveAllTargetsQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void objectAddedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectAdded, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet) throws DatabaseException, OptimisticLockException
objectAddedDuringUpdate
in class CollectionMapping
DatabaseException
OptimisticLockException
protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectDeleted) throws DatabaseException, OptimisticLockException
objectRemovedDuringUpdate
in class CollectionMapping
DatabaseException
OptimisticLockException
public void performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException, DescriptorException
performDataModificationEvent
in class DatabaseMapping
DatabaseException
DescriptorException
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete
in class OneToManyMapping
DatabaseException
OptimisticLockException
public void prepareCascadeLockingPolicy()
prepareCascadeLockingPolicy
in class OneToManyMapping
public void postCalculateChanges(ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)
postCalculateChanges
in class DatabaseMapping
public void postCalculateChangesOnDeleted(java.lang.Object deletedObject, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet uowChangeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
postCalculateChangesOnDeleted
in class DatabaseMapping
public void postInsert(WriteObjectQuery query) throws DatabaseException
- Extract primary key and its value from the source object.
- Extract target key and its value from the target object.
- Construct a insert statement with above fields and values for relation table.
- execute the statement.
- Repeat above three statements until all the target objects are done.
postInsert
in class OneToManyMapping
DatabaseException
protected void postPrepareNestedBatchQuery(ReadQuery batchQuery, ReadAllQuery query)
postPrepareNestedBatchQuery
in class ForeignReferenceMapping
public void postUpdate(WriteObjectQuery query) throws DatabaseException
postUpdate
in class OneToManyMapping
DatabaseException
protected void prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
prepareTranslationRow
in class CollectionMapping
public void setAddTargetSQLString(java.lang.String sqlString)
public void setCustomAddTargetQuery(DataModifyQuery query)
public void setCustomRemoveTargetQuery(DataModifyQuery query)
public void setCustomRemoveAllTargetsQuery(DataModifyQuery query)
public void setSessionName(java.lang.String name)
setSessionName
in class CollectionMapping
public void setShouldIncrementTargetLockValueOnAddOrRemoveTarget(boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget)
public void setShouldIncrementTargetLockValueOnDeleteSource(boolean shouldIncrementTargetLockValueOnDeleteSource)
public boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget()
public boolean shouldIncrementTargetLockValueOnDeleteSource()
public void updateTargetForeignKeysPostInsertSource(WriteObjectQuery query) throws DatabaseException
- Extract primary key and its value from the source object.
- Extract target key and its value from the target object.
- Construct an update statement with above fields and values for target table.
- execute the statement.
- Repeat above three statements until all the target objects are done.
DatabaseException
public void updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query, java.lang.Object objectAdded) throws DatabaseException
- Extract primary key and its value from the source object.
- Extract target key and its value from the target object.
- Construct an update statement with above fields and values for target table.
- execute the statement.
DatabaseException
public void updateTargetForeignKeyPostUpdateSource_ObjectRemoved(ObjectLevelModifyQuery query, java.lang.Object objectRemoved) throws DatabaseException
- Extract primary key and its value from the source object.
- Extract target key and its value from the target object.
- Construct an update statement with above fields and values for target table.
- execute the statement.
DatabaseException
public void updateTargetForeignKeyPreDeleteSource(ObjectLevelModifyQuery query) throws DatabaseException
- Extract primary key and its value from the source object.
- Extract target key and its value from the target object.
- Construct an update statement with above fields and values for target table.
- execute the statement.
DatabaseException
|
EclipseLink 1.1.4, build 'v20100812-r7860' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |