Purpose: Abstract class for relationship mappings which store collection of objects
| Modifier and Type | Field and Description |
|---|---|
| protected transient DataModifyQuery | changeOrderTargetQuery
Query used when order of list members is changed. |
| protected ContainerPolicy | |
| protected transient ModifyQuery | deleteAllQuery
Used for delete all in m-m, dc and delete all optimization in 1-m. |
| protected transient boolean | |
| protected boolean | |
| protected boolean | isListOrderFieldSupported
Indicates whether the mapping supports listOrderField, if it doesn't attempt to set listOrderField throws exception. |
| protected static boolean | isSynchronizeOnMerge
Flag to indicate if collection needs to be synchronized instead of cloning during merge. |
| protected DatabaseField | listOrderField
Field holds the order of elements in the list in the db, requires collection of type List, may be not null only in case isListOrderFieldSupported==true |
| protected Boolean | mustDeleteReferenceObjectsOneByOne
Store if the mapping can batch delete reference objects. |
| protected OrderCorrectionType | orderCorrectionType
Specifies what should be done if the list of values read from listOrserField is invalid (there should be no nulls, no duplicates, no "holes"). |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAggregateOrderBy(String aggregateName, String queryKeyName, boolean isDescending)
PUBLIC: Provide order support for queryKeyName in ascending or descending order. |
| public void | addAscendingOrdering(String queryKeyName)
PUBLIC: Provide order support for queryKeyName in ascending order |
| public void | addDescendingOrdering(String queryKeyName)
PUBLIC: Provide order support for queryKeyName in descending order. |
| public void | addOrderBy(String queryKeyName, boolean isDescending)
PUBLIC: Provide order support for queryKeyName in descending or ascending order. |
| public Object | buildBackupCloneForPartObject(Object
TODO attributeValue, Object TODO clone, Object TODO backup, UnitOfWorkImpl TODO unitOfWork)Implements abstract org. |
| public ChangeRecord | buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session)
Overrides org. |
| public Object | buildCloneForPartObject(Object
TODO attributeValue, Object TODO original, CacheKey TODO cacheKey, Object TODO clone, AbstractSession TODO cloningSession, Integer TODO refreshCascade, boolean TODO isExisting, boolean TODO isFromSharedCache)Implements abstract org. |
| public Object | buildContainerClone(Object
TODO attributeValue, AbstractSession TODO cloningSession)Overrides org. |
| public void | buildCopy(Object
TODO copy, Object TODO original, CopyGroup TODO group)Overrides org. |
| public Object | buildElementClone(Object element, Object parent, CacheKey parentCacheKey, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
INTERNAL: Clone the element, if necessary. |
| public Object | buildElementUnitOfWorkClone(Object element, Object parent, Integer refreshCascade, UnitOfWorkImpl unitOfWork, boolean isExisting, boolean isFromSharedCache)
INTERNAL: Clone the element, if necessary. |
| public Expression | buildExpression(Object
TODO queryObject, QueryByExamplePolicy TODO policy, Expression TODO expressionBuilder, Map<K, V> TODO processedObjects, AbstractSession TODO session)Overrides org. |
| protected void | |
| public Object[] | buildReferencesPKList(Object entity, Object attribute, AbstractSession session)
Implements abstract org. |
| public void | calculateDeferredChanges(ChangeRecord
TODO changeRecord, AbstractSession TODO session)Overrides org. |
| public void | cascadeDiscoverAndPersistUnregisteredNewObjects(Object
TODO object, Map<K, V> TODO newObjects, Map<K, V> TODO unregisteredExistingObjects, Map<K, V> TODO visitedObjects, UnitOfWorkImpl TODO uow, Set<E> TODO cascadeErrors)Overrides org. |
| public void | cascadePerformRemoveIfRequired(Object
TODO object, UnitOfWorkImpl TODO uow, Map<K, V> TODO visitedObjects)Implements abstract org. |
| public void | cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object
TODO object, UnitOfWorkImpl TODO uow, Map<K, V> TODO visitedObjects)
INTERNAL:
Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet
|
| public void | cascadeRegisterNewIfRequired(Object
TODO object, UnitOfWorkImpl TODO uow, Map<K, V> TODO visitedObjects)Implements abstract org. |
| public Object | clone()
Overrides org. |
| public void | collectQueryParameters(Set<DatabaseField>
TODO record)Implements abstract org. |
| public void | compareCollectionsForChange(Object oldCollection, Object newCollection, ChangeRecord changeRecord, AbstractSession session)
INTERNAL: This method is used to calculate the differences between two collections. |
| public ChangeRecord | compareForChange(Object
TODO clone, Object TODO backUp, ObjectChangeSet TODO owner, AbstractSession TODO session)Implements abstract org. |
| protected boolean | compareLists(List<E> firstList, List<E> secondList, AbstractSession session, boolean withPrivateOwned)
Compare two lists. |
| protected void | compareListsAndWrite(List<E> previousList, List<E> currentList, WriteObjectQuery query)
INTERNAL: Old and new lists are compared and only the changes are written to the database. |
| public boolean | compareObjects(Object
TODO firstObject, Object TODO secondObject, AbstractSession TODO session)Overrides org. |
| protected void | compareObjectsAndWrite(WriteObjectQuery query)
INTERNAL: The memory objects are compared and only the changes are written to the database. |
| protected boolean | compareObjectsWithoutPrivateOwned(Object firstCollection, Object secondCollection, AbstractSession session)
Implements abstract org. |
| protected boolean | compareObjectsWithPrivateOwned(Object firstCollection, Object secondCollection, AbstractSession session)
Implements abstract org. |
| public void | convertClassNamesToClasses(ClassLoader
TODO classLoader)Overrides org. |
| protected Object | |
| protected void | executeBatchQuery(DatabaseQuery query, CacheKey parentCacheKey, Map<K, V> referenceObjectsByKey, AbstractSession session, AbstractRecord translationRow)
Overrides org. |
| protected Object | extractKeyFromTargetRow(AbstractRecord row, AbstractSession session)
INTERNAL: Extract the source primary key value from the target row. |
| public Object | extractResultFromBatchQuery(ReadQuery batchQuery, CacheKey parentCacheKey, AbstractRecord sourceRow, AbstractSession session, ObjectLevelReadQuery originalQuery)
Overrides org. |
| public void | fixRealObjectReferences(Object
TODO object, Map<Object, ObjectDescriptor> TODO objectDescriptors, Map<Object, Object> TODO processedObjects, ObjectLevelReadQuery TODO query, DistributedSession TODO session)Overrides org. |
| protected Expression | getAdditionalFieldsBaseExpression(ReadQuery query)
INTERNAL: Return the base expression to use for adding fields to the query. |
| public ContainerPolicy | getContainerPolicy()
Overrides org. Implements org. |
| protected ModifyQuery | |
| public Expression | getJoinCriteria(ObjectExpression context, Expression base)
Overrides org. |
| public DatabaseField | getListOrderField()
PUBLIC: Field holds the order of elements in the list in the db, requires collection of type List; may be not null only in case isListOrderFieldSupported==true. |
| public Object | getObjectCorrespondingTo(Object
TODO object, DistributedSession TODO session, Map<Object, ObjectDescriptor> TODO objectDescriptors, Map<Object, Object> TODO processedObjects, ObjectLevelReadQuery TODO query)Overrides org. |
| public List | |
| public OrderCorrectionType | getOrderCorrectionType()
PUBLIC: Specifies what should be done if the list of values read from listOrserField is invalid (there should be no nulls, no duplicates, no "holes"). |
| public Object | getRealCollectionAttributeValueFromObject(Object object, AbstractSession session)
Overrides org. |
| protected ContainerPolicy | getSelectionQueryContainerPolicy()
INTERNAL: Get the container policy from the selection query for this mapping. |
| public List | getTargetPrimaryKeyFields()
INTERNAL: Returns list of primary key fields from the reference descriptor. |
| protected boolean | |
| public boolean | hasOrderBy()
INTERNAL: Return true if ascending or descending ordering has been set on this mapping via the @OrderBy annotation. |
| public void | initialize(AbstractSession session)
Overrides org. |
| protected void | initializeChangeOrderTargetQuery(AbstractSession session)
INTERNAL: Initialize changeOrderTargetQuery. |
| protected void | |
| protected void | initializeListOrderFieldTable(AbstractSession session)
INTERNAL: Initializes listOrderField's table, does nothing by default. |
| public boolean | isAttributeValueInstantiatedOrChanged(Object object)
INTERNAL: The referenced object is checked if it is instantiated or not, also check if it has been changed (as indirect collections avoid instantiation on add/remove. |
| public boolean | isChangeTrackingSupported(Project project)
Overrides org. |
| public boolean | isCollectionMapping()
Overrides org. |
| public boolean | isListOrderFieldSupported()
PUBLIC: indicates whether the mapping supports listOrderField, if it doesn't attempt to set listOrderField throws exception. |
| public boolean | isMapKeyObjectRelationship()
INTERNAL: Return if this mapping has a mapped key that uses a OneToOne (object). |
| public void | iterateOnElement(DescriptorIterator iterator, Object element)
INTERNAL: Iterate on the specified element. |
| public void | iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue)
Implements abstract org. |
| public void | load(final Object object, AttributeItem item, final AbstractSession session, final boolean fromFetchGroup)
Overrides org. |
| public void | loadAll(Object object, AbstractSession session, IdentityHashSet loaded)
Overrides org. |
| public void | mergeChangesIntoObject(Object target, ChangeRecord chgRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)
Implements abstract org. |
| public void | mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)
Implements abstract org. |
| public boolean | mustDeleteReferenceObjectsOneByOne()
ADVANCED: Return whether the reference objects must be deleted one by one, as opposed to with a single DELETE statement. |
| protected void | objectAddedDuringUpdate(ObjectLevelModifyQuery query, Object objectAdded, ObjectChangeSet changeSet, Map<K, V> extraData)
INTERNAL: An object was added to the collection during an update, insert it if private. |
| protected void | |
| protected void | objectRemovedDuringUpdate(ObjectLevelModifyQuery query, Object objectDeleted, Map<K, V> extraData)
INTERNAL: An object was removed to the collection during an update, delete it if private. |
| protected void | objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object)
INTERNAL: An object is still in the collection, update it as it may have changed. |
| protected void | objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Map<K, V> backupclones, Object key)
INTERNAL: An object is still in the collection, update it as it may have changed. |
| public void | postCalculateChanges(ChangeRecord changeRecord, UnitOfWorkImpl uow)
Overrides org. |
| public void | postDelete(DeleteObjectQuery query)
Overrides org. |
| public void | postInitialize(AbstractSession session)
Overrides org. |
| public void | postInsert(WriteObjectQuery query)
Overrides org. |
| protected void | postPrepareNestedBatchQuery(ReadQuery batchQuery, ObjectLevelReadQuery query)
Overrides org. |
| public void | preInsert(WriteObjectQuery query)
Overrides org. |
| protected void | prepareTranslationRow(AbstractRecord translationRow, Object object, ClassDescriptor descriptor, AbstractSession session)
INTERNAL: copies the non primary key information into the row currently used only in ManyToMany |
| public void | preUpdate(WriteObjectQuery query)
Overrides org. |
| protected Object | readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery)
INTERNAL: All the privately owned parts are read |
| public void | recordPrivateOwnedRemovals(Object object, UnitOfWorkImpl uow)
Overrides org. |
| public Map | replaceValueHoldersIn(Object object, RemoteSessionController controller)
Overrides org. |
| public void | setChangeListener(Object clone, PropertyChangeListener listener, UnitOfWorkImpl uow)
Overrides org. |
| public void | setContainerPolicy(ContainerPolicy containerPolicy)
Implements org. |
| public void | setCustomDeleteAllQuery(ModifyQuery query)
PUBLIC: The default delete all query for mapping can be overridden by specifying the new query. |
| public void | |
| protected void | |
| public void | |
| protected void | |
| public void | setListOrderField(DatabaseField field)
PUBLIC: Field holds the order of elements in the list in the db, requires collection of type List. |
| public void | setListOrderFieldName(String fieldName)
PUBLIC: Field holds the order of elements in the list in the db, requires collection of type List. |
| public void | setMustDeleteReferenceObjectsOneByOne(Boolean deleteOneByOne)
ADVANCED:: Return whether the reference objects must be deleted one by one, as opposed to with a single DELETE statement. |
| public void | setOrderCorrectionType(OrderCorrectionType orderCorrectionType)
PUBLIC: Specifies what should be done if the list of values read from listOrserField is invalid (there should be no nulls, no duplicates, no "holes"). |
| protected void | setSelectionQueryContainerPolicy(ContainerPolicy containerPolicy)
INTERNAL: Set the container policy on the selection query for this mapping. |
| public void | setSessionName(String name)
PUBLIC: Set the name of the session to execute the mapping's queries under. |
| public void | setUseLazyInstantiationForIndirectCollection(Boolean useLazyInstantiation)
ADVANCED: Calling this method will only affect behavior of mappings using transparent indirection This method should only be called after this mapping's indirection policy has been set IndirectList and IndirectSet can be configured not to instantiate the list from the database when you add and remove from them. |
| public Boolean | shouldUseLazyInstantiationForIndirectCollection()
ADVANCED: This method should only be called after this mapping's indirection policy has been set IndirectList and IndirectSet can be configured not to instantiate the list from the database when you add and remove from them. |
| public boolean | shouldUseListOrderFieldTableExpression()
INTERNAL: Indicates whether getListOrderFieldExpression method should create field expression based on table expression. |
| 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 void | updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow)
Overrides org. |
| public void | updateChangeRecordForSelfMerge(ChangeRecord changeRecord, Object source, Object target, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork)
Implements abstract org. |
| public void | updateCollectionChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, UnitOfWorkImpl uow)
Overrides org. |
| public void | useCollectionClass(Class<?> concreteClass)
Implements org. |
| public void | useCollectionClassName(String concreteClassName)
Implements org. |
| public void | useListClassName(String concreteClassName)
Implements org. |
| public void | useMapClass(Class<?> concreteClass, String keyName)
Implements org. |
| public void | useMapClass(Class<?> concreteClass)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects. |
| public void | useMapClassName(String concreteClassName, String methodName)
Implements org. |
| public void | useSortedSetClass(Class<?> concreteClass, Comparator<T> comparator)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects. |
| public void | useSortedSetClassName(String className)
INTERNAL: Configure the mapping to use an instance of the specified container class name to hold the target objects. |
| public void | useSortedSetClassName(String className, String comparatorClassName)
INTERNAL: Configure the mapping to use an instance of the specified container class name to hold the target objects. |
| public void | useTransparentCollection()
PUBLIC: If transparent indirection is used, a special collection will be placed in the source object's attribute. |
| public void | useTransparentList()
PUBLIC: If transparent indirection is used, a special collection will be placed in the source object's attribute. |
| public void | useTransparentMap(String methodName)
PUBLIC: If transparent indirection is used, a special map will be placed in the source object's attribute. |
| public void | useTransparentSet()
PUBLIC: If transparent indirection is used, a special collection will be placed in the source object's attribute. |
| public void | validateBeforeInitialization(AbstractSession session)
Overrides org. |
| public Object | valueFromPKList(Object[] pks, AbstractRecord foreignKeys, AbstractSession session)
Implements abstract org. |
| protected Object | valueFromRowInternalWithJoin(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey parentCacheKey, AbstractSession executionSession, boolean isTargetProtected)
Overrides org. |
| public boolean | verifyDelete(Object object, AbstractSession session)
Overrides org. |
| public void | writeChanges(ObjectChangeSet changeSet, WriteObjectQuery query)
INTERNAL: Write the changes defined in the change set for the mapping. |