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. |
org.eclipse.persistence.eis.EISDescriptor#useIndexedRecordFormat , org.eclipse.persistence.eis.EISDescriptor#useMappedRecordFormat , org.eclipse.persistence.eis.EISDescriptor#useXMLRecordFormat
| Modifier and Type | Field and Description |
|---|---|
| protected DatabaseField | foreignKeyGroupingElement
The grouping-element field. |
| protected boolean | isForeignKeyRelationship
Keeps track if any of the fields are foreign keys. |
| protected transient List | sourceForeignKeyFields
The (typically primary) source key fields that are referenced by the targetForeignKeyFields. |
| protected transient Map | sourceForeignKeysToTargetKeys
This maps the source foreign key fields to the corresponding (primary) target key fields. |
| protected transient List | targetForeignKeyFields
The target foreign key fields that reference the sourceKeyFields. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addForeignKeyField(DatabaseField sourceForeignKeyField, DatabaseField targetKeyField)
Overrides org. |
| public void | addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping. |
| public Object | buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)
INTERNAL: Build and return a new element based on the change set. |
| public Object | buildChangeSet(Object element, ObjectChangeSet owner, AbstractSession session)
INTERNAL: Build and return a change set for the specified element. |
| protected Object | buildElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)
Build and return a new element based on the change set. |
| public Object | buildElementFromElement(Object element, MergeManager mergeManager, AbstractSession targetSession)
INTERNAL: Build and return a new element based on the specified element. |
| public Expression | buildExpression(Object
TODO queryObject, QueryByExamplePolicy TODO policy, Expression TODO expressionBuilder, Map<K, V> TODO processedObjects, AbstractSession TODO session)Overrides org. |
| public Object | buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)
INTERNAL: Build and return a new element based on the change set. |
| public Object | clone()
Overrides org. |
| protected Vector | collectFields()
Overrides org. |
| public boolean | compareElements(Object element1, Object element2, AbstractSession session)
INTERNAL: Compare the non-null elements and return true if they are alike. |
| public boolean | compareElementsForChange(Object element1, Object element2, AbstractSession session)
INTERNAL: Compare the non-null elements and return true if they are alike. |
| public ChangeRecord | compareForChange(Object
TODO clone, Object TODO backup, ObjectChangeSet TODO owner, AbstractSession TODO session)Overrides org. |
| public boolean | compareObjects(Object
TODO object1, Object TODO object2, AbstractSession TODO session)Overrides org. |
| protected void | |
| protected void | |
| protected void | deleteReferenceObjectsLeftOnDatabase(DeleteObjectQuery query)
This method will make sure that all the records privately owned by this mapping are actually removed. |
| protected AbstractRecord | extractKeyRowFromReferenceObject(Object object, AbstractSession session, AbstractRecord parentRecord)
Build and return a database row that contains a foreign key for the specified reference object. |
| public ModifyQuery | |
| public DatabaseField | |
| public Vector | |
| public List | |
| public Map | |
| public List | |
| public boolean | |
| public boolean | hasInverseConstraintDependency()
Overrides org. |
| public void | initialize(AbstractSession session)
Overrides org. |
| protected void | |
| protected void | initializeSelectionCriteria(AbstractSession session)
INTERNAL: Selection criteria is created with source foreign keys and target keys. |
| protected void | |
| public boolean | |
| public boolean | isForeignKeyRelationship()
INTERNAL: Return if the 1-M mapping has a foreign key dependency to its target. |
| public boolean | mapKeyHasChanged(Object element, AbstractSession session)
INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version. |
| public void | mergeChangesIntoObject(Object target, ChangeRecord chgRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)
Overrides org. |
| public void | mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)
Overrides org. |
| public void | postDelete(DeleteObjectQuery query)
Overrides org. |
| public void | postInsert(WriteObjectQuery query)
Overrides org. |
| public void | postUpdate(WriteObjectQuery query)
Overrides org. |
| public void | preDelete(DeleteObjectQuery query)
Overrides org. |
| public void | preInitialize(AbstractSession session)
Overrides org. |
| public void | preInsert(WriteObjectQuery query)
Overrides org. |
| public void | preUpdate(WriteObjectQuery query)
Overrides org. |
| public void | setDeleteAllCall(Call call)
Overrides org. |
| public void | setDeleteAllSQLString(String sqlString)
Overrides org. |
| public void | |
| public void | |
| public void | setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
INTERNAL: Set if the 1-M mapping has a foreign key dependency to its target. |
| public void | setSelectionSQLString(String sqlString)
Overrides org. |
| public void | |
| public void | setSourceForeignKeysToTargetKeys(Map<DatabaseField, DatabaseField> sourceToTargetKeyFields)
INTERNAL: Set the source keys to target keys fields association. |
| public void | |
| protected boolean | shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
Overrides org. |
| public void | simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)
Overrides org. |
| public void | simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)
Overrides org. |
| public Object | valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed)
Overrides org. |
| public boolean | verifyDelete(Object object, AbstractSession session)
Overrides org. |
| public void | writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.
Overrides org. |
| public void | writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session)
Overrides org. |
| public void | writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session)
INTERNAL:
This row is built for shallow insert which happens in case of bidirectional inserts.
|
| public void | writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row)
Overrides org. |
| public void | writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table)
Overrides org. |
| public void | writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session, DatabaseMapping.
Overrides org. |
| public void | writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session)
Overrides org. |