Purpose: This mapping is used to represent the typical RDBMS relationship between a single source object and collection of target objects; where, on the database, the target objects have references (foreign keys) to the source object.
| Modifier and Type | Field and Description |
|---|---|
| protected DataModifyQuery | addTargetQuery
Query used to update a single target row setting its foreign key to point to the source. |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected static final String | |
| protected static final String | |
| protected static final String | PostInsert
Used for data modification events. |
| 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 | |
| protected transient List | sourceExpressionsToPostInitialize
Keep a reference to the source and target expressions to post initialize when building a selection criteria early. |
| protected Vector | sourceKeyFields
The (typically primary) source key fields that are referenced by the targetForeignKeyFields. |
| protected transient Map | sourceKeysToTargetForeignKeys
This maps the (primary) source key fields to the corresponding target foreign key fields. |
| protected transient List | |
| protected Vector | targetForeignKeyFields
The target foreign key fields that reference the sourceKeyFields. |
| protected transient Map | targetForeignKeysToSourceKeys
This maps the target foreign key fields to the corresponding (primary) source key fields. |
| protected transient DatabaseTable | targetForeignKeyTable
All targetForeignKeyFields should have the same table. |
| protected transient List | targetPrimaryKeyFields
Primary keys of targetForeignKeyTable: the same as referenceDescriptor().getPrimaryKeyFields() in case the table is default table of reference descriptor; otherwise contains secondary table's primary key fields in the same order as default table primary keys mapped to them. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addTargetForeignKeyField(DatabaseField targetForeignKeyField, DatabaseField sourceKeyField)
Overrides org. |
| public void | addTargetForeignKeyFieldName(String targetForeignKeyFieldName, String sourceKeyFieldName)
PUBLIC: Define the target foreign key relationship in the one-to-many mapping. |
| protected Expression | buildBatchCriteria(ExpressionBuilder builder, ObjectLevelReadQuery query)
Overrides org. |
| protected Expression | buildDefaultSelectionCriteriaAndAddFieldsToQuery()
The selection criteria are created with target foreign keys and source "primary" keys. |
| protected AbstractRecord | |
| protected void | buildListOrderField()
Overrides org. |
| public Expression | buildSelectionCriteria()
This method would allow customers to get the potential selection criteria for a mapping prior to initialization. |
| public Object | clone()
Overrides org. Implements org. |
| private Vector | cloneDatabaseFieldVector(Vector<DatabaseField> oldFlds, Map<DatabaseField, DatabaseField> old2cloned)
|
| private Map | cloneKeysMap(Map<DatabaseField, DatabaseField> toClone, Map<DatabaseField, DatabaseField> old2cloned)
|
| public void | collectQueryParameters(Set<DatabaseField>
TODO cacheFields)Overrides org. |
| public Object | createMapComponentFromRow(AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected)
Implements org. |
| protected AbstractRecord | |
| protected void | deleteAll(DeleteObjectQuery query, AbstractSession session)
Delete all the reference objects with a single query. |
| protected void | deleteReferenceObjectsLeftOnDatabase(DeleteObjectQuery query)
This method will make sure that all the records privately owned by this mapping are actually removed. |
| protected Object | extractBatchKeyFromRow(AbstractRecord row, AbstractSession session)
Overrides org. |
| protected Object | extractKeyFromTargetRow(AbstractRecord row, AbstractSession session)
Overrides org. |
| protected ModifyQuery | getDeleteAllQuery()
Overrides org. |
| public Collection | getFieldsForTranslationInAggregate()
Overrides org. |
| protected InsertObjectQuery | getInsertObjectQuery(AbstractSession session, ClassDescriptor desc)
INTERNAL: Returns a clone of InsertObjectQuery from the ClassDescriptor's DescriptorQueryManager or a new one |
| public Vector | |
| public Vector | |
| public Map | |
| public Vector | getTargetForeignKeyFieldNames()
INTERNAL: Return the target foreign key field names associated with the mapping. |
| public Vector | |
| public Map | |
| public List | getTargetPrimaryKeyFields()
Overrides org. |
| public boolean | hasInverseConstraintDependency()
Overrides org. |
| public void | initialize(AbstractSession session)
Overrides org. |
| protected void | |
| protected void | initializeChangeOrderTargetQuery(AbstractSession session)
Overrides org. |
| protected void | |
| protected void | initializeReferenceDescriptor(AbstractSession session)
Overrides org. |
| protected void | |
| protected void | |
| protected void | initializeTargetForeignKeysToSourceKeys()
Verify, munge, and hash the target foreign keys and source keys. |
| protected void | initializeTargetPrimaryKeyFields()
INTERNAL: Initialize targetForeignKeyTable and initializeTargetPrimaryKeyFields. |
| public boolean | isCascadedLockingSupported()
Overrides org. |
| public boolean | isJoiningSupported()
Overrides org. |
| public boolean | isOneToManyMapping()
Overrides org. |
| public boolean | isRelationalMapping()
Overrides org. |
| protected boolean | |
| protected void | objectAddedDuringUpdate(ObjectLevelModifyQuery query, Object objectAdded, ObjectChangeSet changeSet, Map<K, V> extraData)
Overrides org. |
| protected void | objectRemovedDuringUpdate(ObjectLevelModifyQuery query, Object objectDeleted, Map<K, V> extraData)
Overrides org. |
| public void | performDataModificationEvent(Object[] event, AbstractSession session)
Overrides org. |
| public void | postInitializeSourceAndTargetExpressions()
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 | prepareCascadeLockingPolicy()
Overrides org. |
| public boolean | requiresDataModificationEvents()
INTERNAL: Returns whether this mapping uses data modification events to complete its writes |
| public void | |
| public void | setCustomAddTargetQuery(DataModifyQuery query)
PUBLIC: The default add target query for mapping can be overridden by specifying the new query. |
| public void | setCustomRemoveAllTargetsQuery(DataModifyQuery query)
PUBLIC: The default remove all targets query for mapping can be overridden by specifying the new query. |
| public void | setCustomRemoveTargetQuery(DataModifyQuery query)
PUBLIC: The default remove target query for mapping can be overridden by specifying the new query. |
| public void | setDeleteAllSQLString(String sqlString)
Overrides org. |
| public void | setSessionName(String name)
Overrides org. |
| public void | |
| public void | setSourceKeyFieldNames(Vector<E> fieldNames)
INTERNAL: Set the source key field names associated with the mapping. |
| public void | |
| public void | setTargetForeignKeyFieldName(String targetForeignKeyFieldName)
PUBLIC: Define the target foreign key relationship in the one-to-many mapping. |
| public void | setTargetForeignKeyFieldNames(String[] targetForeignKeyFieldNames, String[] sourceKeyFieldNames)
PUBLIC: Define the target foreign key relationship in the one-to-many mapping. |
| public void | setTargetForeignKeyFieldNames(Vector<E> fieldNames)
INTERNAL: Set the target key field names associated with the mapping. |
| public void | setTargetForeignKeyFields(Vector<DatabaseField> targetForeignKeyFields)
INTERNAL: Set the target fields. |
| protected void | setTargetForeignKeysToSourceKeys(Map<DatabaseField, DatabaseField> targetForeignKeysToSourceKeys)
INTERNAL: Set the target fields. |
| public boolean | |
| protected boolean | shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
Overrides org. |
| protected boolean | shouldRemoveTargetQueryModifyTargetForeignKey()
INTERNAL If it's not a map then target foreign key has been already modified (set to null). |
| public void | updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query, Object objectAdded, Map<K, V> extraData)
INTERNAL: Update target foreign key after a target object was added to the source. |
| public void | updateTargetForeignKeyPostUpdateSource_ObjectRemoved(ObjectLevelModifyQuery query, Object objectRemoved)
INTERNAL: Update target foreign key after a target object was removed from the source. |
| public void | updateTargetRowPostInsertSource(WriteObjectQuery query)
INTERNAL: Update target foreign keys after a new source was inserted. |
| public void | updateTargetRowPreDeleteSource(ObjectLevelModifyQuery query)
INTERNAL: Update target foreign key after a target object was removed from the source. |
| public boolean | verifyDelete(Object object, AbstractSession session)
Overrides org. |