org.eclipse.persistence.eis.mappings
public class EISOneToManyMapping extends CollectionMapping implements EISMapping
An EIS one-to-many mapping is a reference mapping that represents the relationship between a single source object and a collection of mapped persistent Java objects. The source object usually contains a foreign key (pointer) to the target objects (key on source); alternatively, the target objects may contain a foreign key to the source object (key on target). Because both the source and target objects use interactions, they must all be configured as root object types.
Record Type | Description |
---|---|
Indexed | Ordered collection of record elements. The indexed record EIS format enables Java class attribute values to be retreived by position or index. |
Mapped | Key-value map based representation of record elements. The mapped record EIS format enables Java class attribute values to be retreived by an object key. |
XML | Record/Map representation of an XML DOM element. |
EISDescriptor.useIndexedRecordFormat()
,
EISDescriptor.useMappedRecordFormat()
,
EISDescriptor.useXMLRecordFormat()
,
Serialized FormDatabaseMapping.WriteType
INNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER
Constructor and Description |
---|
EISOneToManyMapping() |
Modifier and Type | Method and Description |
---|---|
void |
addAscendingOrdering(String queryKeyName)
INTERNAL:
This method is not supported in an EIS environment.
|
void |
addDescendingOrdering(String queryKeyName)
INTERNAL:
This method is not supported in an EIS environment.
|
void |
addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
PUBLIC:
Define the source foreign key relationship in the one-to-many mapping.
|
void |
addForeignKeyFieldName(String sourceForeignKeyFieldName,
String targetKeyFieldName)
PUBLIC:
Define the source foreign key relationship in the one-to-many mapping.
|
Object |
buildAddedElementFromChangeSet(Object changeSet,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL:
Build and return a new element based on the change set.
|
Object |
buildChangeSet(Object element,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Build and return a change set for the specified element.
|
Object |
buildElementFromElement(Object element,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL:
Build and return a new element based on the specified element.
|
Object |
buildRemovedElementFromChangeSet(Object changeSet,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL:
Build and return a new element based on the change set.
|
Object |
clone()
INTERNAL:
Clone the appropriate attributes.
|
boolean |
compareElements(Object element1,
Object element2,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the non-null elements and return true if they are alike.
|
boolean |
compareElementsForChange(Object element1,
Object element2,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the non-null elements and return true if they are alike.
|
org.eclipse.persistence.internal.sessions.ChangeRecord |
compareForChange(Object clone,
Object backup,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the changes between two collections.
|
boolean |
compareObjects(Object object1,
Object object2,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the attributes belonging to this mapping for the objects.
|
void |
dontUseBatchReading()
INTERNAL:
This method is not supported in an EIS environment.
|
ModifyQuery |
getDeleteAllQuery() |
XMLField |
getForeignKeyGroupingElement()
Get the grouping element field on the mapping.
|
Vector |
getForeignKeyRows(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL:
|
List |
getSourceForeignKeyFields()
INTERNAL:
Return the source foreign key fields.
|
Map |
getSourceForeignKeysToTargetKeys()
INTERNAL:
Sets the target foreign key fields.
|
List |
getTargetForeignKeyFields()
INTERNAL:
Return the source foreign key fields.
|
boolean |
hasCustomDeleteAllQuery() |
boolean |
hasInverseConstraintDependency()
INTERNAL:
Return whether the mapping has any inverse constraint dependencies,
such as foreign keys.
|
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Initialize the mapping.
|
boolean |
isEISMapping()
INTERNAL:
|
boolean |
isForeignKeyRelationship()
INTERNAL:
Return if the 1-M mapping has a foreign key dependency to its target.
|
boolean |
mapKeyHasChanged(Object element,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Return whether the element's user-defined Map key has changed
since it was cloned from the original version.
|
void |
postDelete(DeleteObjectQuery query)
INTERNAL:
Delete the reference objects.
|
void |
postInsert(WriteObjectQuery query)
INTERNAL:
Insert the reference objects.
|
void |
postUpdate(WriteObjectQuery query)
INTERNAL:
Update the reference objects.
|
void |
preDelete(DeleteObjectQuery query)
INTERNAL:
Delete the reference objects.
|
void |
preInsert(WriteObjectQuery query)
INTERNAL:
Insert privately owned parts
|
void |
preUpdate(WriteObjectQuery query)
INTERNAL:
Update the privately owned parts.
|
void |
setDeleteAllCall(Call call)
PUBLIC:
The default delete all call for this mapping can be overridden by specifying the new call.
|
void |
setDeleteAllSQLString(String sqlString)
INTERNAL:
This method is not supported in an EIS environment.
|
void |
setForeignKeyGroupingElement(String xpath)
Set the grouping element field on the mapping.
|
void |
setForeignKeyGroupingElement(XMLField field)
Set if the grouping element field on the mapping.
|
void |
setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
INTERNAL:
Set if the 1-M mapping has a foreign key dependency to its target.
|
void |
setSelectionCriteria(Expression anExpression)
INTERNAL:
This method is not supported in an EIS environment.
|
void |
setSelectionSQLString(String sqlString)
INTERNAL:
This method is not supported in an EIS environment.
|
void |
setSourceForeignKeyFields(List fields)
INTERNAL:
Sets the source foreign key fields.
|
void |
setSourceForeignKeysToTargetKeys(Map sourceToTargetKeyFields)
INTERNAL:
Set the source keys to target keys fields association.
|
void |
setTargetForeignKeyFields(List fields)
INTERNAL:
Sets the target foreign key fields.
|
void |
setUsesBatchReading(boolean usesBatchReading)
INTERNAL:
This method is not supported in an EIS environment.
|
boolean |
shouldUseBatchReading()
INTERNAL:
This method is not supported in an EIS environment.
|
void |
simpleAddToCollectionChangeRecord(Object referenceKey,
Object changeSetToAdd,
org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
org.eclipse.persistence.internal.sessions.AbstractSession session)
ADVANCED:
This method is used to have an object add to a collection once the changeSet is applied
The referenceKey parameter should only be used for direct Maps.
|
void |
simpleRemoveFromCollectionChangeRecord(Object referenceKey,
Object changeSetToRemove,
org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
org.eclipse.persistence.internal.sessions.AbstractSession session)
ADVANCED:
This method is used to have an object removed from a collection once the changeSet is applied
The referenceKey parameter should only be used for direct Maps.
|
void |
useBatchReading()
INTERNAL:
This method is not supported in an EIS environment.
|
Object |
valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL:
Return the value of the reference attribute or a value holder.
|
boolean |
verifyDelete(Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Used to verify whether the specified object is deleted or not.
|
void |
writeFromObjectIntoRow(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL:
Get the appropriate attribute value from the object
and put it in the appropriate field of the database row.
|
void |
writeFromObjectIntoRowForShallowInsert(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery,
org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL:
If any of the references objects has changed, write out
all the keys.
|
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL:
Get the appropriate attribute value from the object
and put it in the appropriate field of the database row.
|
void |
writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Write fields needed for insert into the template for with null values.
|
addAggregateOrderBy, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildElementClone, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, compareCollectionsForChange, convertClassNamesToClasses, extractResultFromBatchQuery, fixRealObjectReferences, getContainerPolicy, getJoinCriteria, getListOrderField, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getTargetPrimaryKeyFields, hasOrderBy, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, iterateOnElement, iterateOnRealAttributeValue, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postInitialize, recordPrivateOwnedRemovals, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setListOrderField, setListOrderFieldName, setOrderCorrectionType, setSessionName, shouldUseListOrderFieldTableExpression, updateChangeRecord, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList
buildBackupClone, buildClone, buildCloneFromRow, createUnitOfWorkValueHolder, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getIndirectionPolicy, getJoinFetch, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getValueFromRemoteValueHolder, hasCustomSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareNestedBatchQuery, prepareNestedJoins, privateOwnedRelationship, remoteInitialization, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setShouldExtendPessimisticLockScope, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, trimRowForJoin, trimRowForJoin, useBasicIndirection, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection
buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, derivesId, earlyPreDelete, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasMapsIdValue, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
public boolean isEISMapping()
isEISMapping
in class DatabaseMapping
public void addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
public void addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName)
public boolean isForeignKeyRelationship()
public void setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
public XMLField getForeignKeyGroupingElement()
public void setForeignKeyGroupingElement(String xpath)
public boolean hasCustomDeleteAllQuery()
public ModifyQuery getDeleteAllQuery()
public void setDeleteAllCall(Call call)
setDeleteAllCall
in class CollectionMapping
public void setForeignKeyGroupingElement(XMLField field)
public List getSourceForeignKeyFields()
public void setSourceForeignKeyFields(List fields)
public List getTargetForeignKeyFields()
public void setTargetForeignKeyFields(List fields)
public Map getSourceForeignKeysToTargetKeys()
public void setSourceForeignKeysToTargetKeys(Map sourceToTargetKeyFields)
public boolean hasInverseConstraintDependency()
hasInverseConstraintDependency
in class DatabaseMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class CollectionMapping
DescriptorException
public boolean verifyDelete(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
verifyDelete
in class CollectionMapping
DatabaseException
public void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postInsert
in class CollectionMapping
DatabaseException
OptimisticLockException
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postUpdate
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void postDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
postDelete
in class CollectionMapping
DatabaseException
OptimisticLockException
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preInsert
in class CollectionMapping
DatabaseException
OptimisticLockException
public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preUpdate
in class CollectionMapping
DatabaseException
OptimisticLockException
public Object buildAddedElementFromChangeSet(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
public Object buildChangeSet(Object element, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
public Object buildElementFromElement(Object element, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
public Object buildRemovedElementFromChangeSet(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
public Object clone()
clone
in class CollectionMapping
public boolean compareElements(Object element1, Object element2, org.eclipse.persistence.internal.sessions.AbstractSession session)
public boolean mapKeyHasChanged(Object element, org.eclipse.persistence.internal.sessions.AbstractSession session)
public boolean compareElementsForChange(Object element1, Object element2, org.eclipse.persistence.internal.sessions.AbstractSession session)
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(Object clone, Object backup, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
compareForChange
in class CollectionMapping
public boolean compareObjects(Object object1, Object object2, org.eclipse.persistence.internal.sessions.AbstractSession session)
compareObjects
in class CollectionMapping
public void simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
simpleAddToCollectionChangeRecord
in class CollectionMapping
public void simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
simpleRemoveFromCollectionChangeRecord
in class CollectionMapping
public Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession) throws DatabaseException
valueFromRow
in class ForeignReferenceMapping
DatabaseException
public Vector getForeignKeyRows(org.eclipse.persistence.internal.sessions.AbstractRecord row)
public void writeFromObjectIntoRow(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow
in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsert(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsert
in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsertWithChangeRecord
in class DatabaseMapping
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, org.eclipse.persistence.internal.sessions.AbstractRecord row) throws DescriptorException
writeFromObjectIntoRowForUpdate
in class DatabaseMapping
DescriptorException
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
writeFromObjectIntoRowWithChangeRecord
in class DatabaseMapping
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
writeInsertFieldsIntoRow
in class DatabaseMapping
public void setSelectionSQLString(String sqlString)
setSelectionSQLString
in class ForeignReferenceMapping
public void setSelectionCriteria(Expression anExpression)
setSelectionCriteria
in class ForeignReferenceMapping
public void setUsesBatchReading(boolean usesBatchReading)
setUsesBatchReading
in class ForeignReferenceMapping
ForeignReferenceMapping.setBatchFetchType(BatchFetchType)
public boolean shouldUseBatchReading()
shouldUseBatchReading
in class ForeignReferenceMapping
public void useBatchReading()
useBatchReading
in class ForeignReferenceMapping
public void dontUseBatchReading()
dontUseBatchReading
in class ForeignReferenceMapping
public void addAscendingOrdering(String queryKeyName)
addAscendingOrdering
in class CollectionMapping
public void addDescendingOrdering(String queryKeyName)
addDescendingOrdering
in class CollectionMapping
public void setDeleteAllSQLString(String sqlString)
setDeleteAllSQLString
in class CollectionMapping