Class AbstractPluralAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A,R,E,V>,A,R,E,V>
java.lang.Object
com.blazebit.persistence.view.impl.update.flush.AttributeFetchGraphNode<X>
com.blazebit.persistence.view.impl.update.flush.AbstractPluralAttributeFlusher<X,A,R,E,V>
- All Implemented Interfaces:
DirtyChecker<V>,PluralDirtyChecker<V,,E> DirtyAttributeFlusher<X,,E, V> FetchGraphNode<X>
- Direct Known Subclasses:
CollectionAttributeFlusher,MapAttributeFlusher
public abstract class AbstractPluralAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A,R,E,V>,A,R,E,V>
extends AttributeFetchGraphNode<X>
implements DirtyAttributeFlusher<X,E,V>, PluralDirtyChecker<V,E>
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classprotected static final classprotected static final classprotected static enumprotected static interfaceprotected static final classprotected static final classprotected static enumNested classes/interfaces inherited from interface com.blazebit.persistence.view.impl.change.DirtyChecker
DirtyChecker.DirtyKind -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CollectionRemoveListenerprotected final booleanprotected final TypeDescriptorprotected final BasicDirtyChecker<Object>protected final AbstractPluralAttributeFlusher.EqualityCheckerprotected final DirtyAttributeFlusher<?,Object, Object> protected final List<CollectionElementAttributeFlusher<E,V>> protected final AttributeAccessorprotected final AbstractPluralAttributeFlusher.PluralFlushOperationprotected final FlushStrategyprotected final booleanprotected final booleanprotected final Class<?>protected final Stringprotected final String[]protected final DirtyAttributeFlusher<?,Object, Object> protected final Stringprotected final Stringprotected final CollectionRemoveListenerprotected final booleanprotected final booleanprotected final InitialValueAttributeAccessorprotected final booleanFields inherited from class com.blazebit.persistence.view.impl.update.flush.AttributeFetchGraphNode
attributeName, fetch, mapping -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPluralAttributeFlusher(AbstractPluralAttributeFlusher<?, ?, ?, ?, ?> original, boolean fetch) protectedAbstractPluralAttributeFlusher(AbstractPluralAttributeFlusher<?, ?, ?, ?, ?> original, boolean fetch, AbstractPluralAttributeFlusher.PluralFlushOperation flushOperation, List<? extends A> collectionActions, List<CollectionElementAttributeFlusher<E, V>> elementFlushers) AbstractPluralAttributeFlusher(String attributeName, String mapping, boolean fetch, Class<?> ownerEntityClass, String ownerIdAttributeName, String ownerMapping, DirtyAttributeFlusher<?, ?, ?> ownerIdFlusher, DirtyAttributeFlusher<?, ?, ?> elementFlusher, boolean supportsCollectionDml, FlushStrategy flushStrategy, AttributeAccessor entityAttributeAccessor, InitialValueAttributeAccessor viewAttributeAccessor, boolean optimisticLockProtected, boolean collectionUpdatable, boolean viewOnlyDeleteCascaded, boolean jpaProviderDeletesCollection, CollectionRemoveListener cascadeDeleteListener, CollectionRemoveListener removeListener, TypeDescriptor elementDescriptor) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddFlatViewElementFlushActions(UpdateContext context, TypeDescriptor elementDescriptor, List<A> actions, V current) booleanappendUpdateQueryFragment(UpdateContext context, StringBuilder sb, String mappingPrefix, String parameterPrefix, String separator) protected abstract booleanprotected abstract booleancollectionEquals(V initial, V current) protected abstract Vprotected abstract CollectionElementAttributeFlusher<E,V> createMergeFlusher(TypeDescriptor typeDescriptor, Object element) protected abstract CollectionElementAttributeFlusher<E,V> createPersistFlusher(TypeDescriptor typeDescriptor, Object element) protected final booleandetermineElementFlushers(UpdateContext context, TypeDescriptor typeDescriptor, List<CollectionElementAttributeFlusher<E, V>> elementFlushers, Iterable<?> values, List<? extends A> actions, V current) javax.persistence.QueryflushQuery(UpdateContext context, String parameterPrefix, UpdateQueryFactory queryFactory, javax.persistence.Query query, Object ownerView, Object view, V value, UnmappedOwnerAwareDeleter ownerAwareDeleter, DirtyAttributeFlusher<?, ?, ?> ownerFlusher) protected abstract DirtyAttributeFlusher<X,E, V> getDirtyFlusherForRecordingCollection(UpdateContext context, R collection) protected abstract List<CollectionElementAttributeFlusher<E,V>> getElementFlushers(UpdateContext context, V current, List<? extends A> actions) protected final DirtyAttributeFlusher<X,E, V> getElementOnlyFlusher(UpdateContext context, V current) protected final VgetEntityAttributeValue(E entity) final Stringprotected FetchGraphNode<?>protected final DirtyAttributeFlusher<X,E, V> getReplaceOrMergeAndElementFlusher(UpdateContext context, V initial, V current) protected final DirtyAttributeFlusher<X,E, V> getReplaceOrMergeOnlyFlusher(UpdateContext context, V initial, V current) protected final DirtyAttributeFlusher<X,E, V> getReplayAndElementFlusher(UpdateContext context, V initial, V current, List<? extends A> collectionActions, List<CollectionElementAttributeFlusher<E, V>> elementFlushers) protected final DirtyAttributeFlusher<X,E, V> getReplayOnlyFlusher(UpdateContext context, V initial, V current, List<? extends A> collectionActions) protected static ObjectgetViewElement(UpdateContext context, TypeDescriptor typeDescriptor, Object jpaCollectionObject) protected static booleanidentityContains(Collection<Object> addedElements, MutableStateTrackable element) protected abstract voidinvokeCollectionAction(UpdateContext context, Object ownerView, Object view, V targetCollection, Object value, List<? extends A> collectionActions) protected voidinvokeFlushOperation(UpdateContext context, Object ownerView, Object view, E entity, V value) protected abstract booleanbooleanbooleanbooleanprotected abstract booleanmergeCollectionElements(UpdateContext context, Object ownerView, Object view, E entity, V value) partialFlusher(boolean fetch, AbstractPluralAttributeFlusher.PluralFlushOperation operation, List<? extends A> collectionActions, List<CollectionElementAttributeFlusher<E, V>> elementFlushers) protected final voidpersistIfNeeded(javax.persistence.EntityManager em, Object object, BasicUserType<Object> basicUserType) protected final <X> XpersistOrMerge(javax.persistence.EntityManager em, X object) protected final <X> XpersistOrMerge(javax.persistence.EntityManager em, X object, TypeDescriptor typeDescriptor) protected abstract voidreplaceCollection(UpdateContext context, Object ownerView, Object view, E entity, V value, FlushStrategy flushStrategy) protected abstract VreplaceWithRecordingCollection(UpdateContext context, Object view, V value, List<? extends A> actions) booleanrequiresDeferredFlush(V value) booleanrequiresFlushAfterPersist(V value) booleanMethods inherited from class com.blazebit.persistence.view.impl.update.flush.AttributeFetchGraphNode
appendFetchJoinQueryFragment, getAttributeName, mergeWithMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.blazebit.persistence.view.impl.update.flush.DirtyAttributeFlusher
appendFetchJoinQueryFragment, cloneDeep, flushEntity, getDirtyFlusher, getNewInitialValue, isViewOnlyDeleteCascaded, remove, remove, removeByOwnerId, removeFromEntity, requiresDeleteCascadeAfterRemoveMethods inherited from interface com.blazebit.persistence.view.impl.change.DirtyChecker
getDirtyKind, getNestedCheckersMethods inherited from interface com.blazebit.persistence.view.impl.update.flush.FetchGraphNode
getAttributeName, mergeWithMethods inherited from interface com.blazebit.persistence.view.impl.change.PluralDirtyChecker
getElementDirtyChecker
-
Field Details
-
ownerEntityClass
-
ownerIdAttributeName
-
ownerMapping
-
ownerIdFlusher
-
supportsCollectionDml
protected final boolean supportsCollectionDml -
ownerIdWhereFragment
-
ownerIdBindFragments
-
elementFlusher
-
flushStrategy
-
entityAttributeAccessor
-
viewAttributeAccessor
-
optimisticLockProtected
protected final boolean optimisticLockProtected -
collectionUpdatable
protected final boolean collectionUpdatable -
viewOnlyDeleteCascaded
protected final boolean viewOnlyDeleteCascaded -
jpaProviderDeletesCollection
protected final boolean jpaProviderDeletesCollection -
cascadeDeleteListener
-
removeListener
-
elementDescriptor
-
elementEqualityChecker
-
elementDirtyChecker
-
flushOperation
-
collectionActions
-
elementFlushers
-
replaceWithReferenceContents
protected final boolean replaceWithReferenceContents- See Also:
-
-
Constructor Details
-
AbstractPluralAttributeFlusher
public AbstractPluralAttributeFlusher(String attributeName, String mapping, boolean fetch, Class<?> ownerEntityClass, String ownerIdAttributeName, String ownerMapping, DirtyAttributeFlusher<?, ?, ?> ownerIdFlusher, DirtyAttributeFlusher<?, ?, ?> elementFlusher, boolean supportsCollectionDml, FlushStrategy flushStrategy, AttributeAccessor entityAttributeAccessor, InitialValueAttributeAccessor viewAttributeAccessor, boolean optimisticLockProtected, boolean collectionUpdatable, boolean viewOnlyDeleteCascaded, boolean jpaProviderDeletesCollection, CollectionRemoveListener cascadeDeleteListener, CollectionRemoveListener removeListener, TypeDescriptor elementDescriptor) -
AbstractPluralAttributeFlusher
protected AbstractPluralAttributeFlusher(AbstractPluralAttributeFlusher<?, ?, ?, ?, ?> original, boolean fetch) -
AbstractPluralAttributeFlusher
protected AbstractPluralAttributeFlusher(AbstractPluralAttributeFlusher<?, ?, ?, ?, ?> original, boolean fetch, AbstractPluralAttributeFlusher.PluralFlushOperation flushOperation, List<? extends A> collectionActions, List<CollectionElementAttributeFlusher<E, V>> elementFlushers)
-
-
Method Details
-
getNestedGraphNode
- Overrides:
getNestedGraphNodein classAttributeFetchGraphNode<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>>
-
appendUpdateQueryFragment
public boolean appendUpdateQueryFragment(UpdateContext context, StringBuilder sb, String mappingPrefix, String parameterPrefix, String separator) - Specified by:
appendUpdateQueryFragmentin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
supportsQueryFlush
public boolean supportsQueryFlush()- Specified by:
supportsQueryFlushin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
loadForEntityFlush
public boolean loadForEntityFlush()- Specified by:
loadForEntityFlushin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
flushQuery
public javax.persistence.Query flushQuery(UpdateContext context, String parameterPrefix, UpdateQueryFactory queryFactory, javax.persistence.Query query, Object ownerView, Object view, V value, UnmappedOwnerAwareDeleter ownerAwareDeleter, DirtyAttributeFlusher<?, ?, ?> ownerFlusher) - Specified by:
flushQueryin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
getEntityAttributeValue
-
createJpaCollection
-
getMapping
- Specified by:
getMappingin interfaceFetchGraphNode<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>> - Overrides:
getMappingin classAttributeFetchGraphNode<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>>
-
invokeFlushOperation
protected void invokeFlushOperation(UpdateContext context, Object ownerView, Object view, E entity, V value) -
invokeCollectionAction
-
replaceWithRecordingCollection
-
isPassThrough
public boolean isPassThrough()- Specified by:
isPassThroughin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
getElementIdAttributeName
- Specified by:
getElementIdAttributeNamein interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
getViewAttributeAccessor
- Specified by:
getViewAttributeAccessorin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
getEntityAttributeAccessor
- Specified by:
getEntityAttributeAccessorin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
getLockOwner
- Specified by:
getLockOwnerin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
isOptimisticLockProtected
public boolean isOptimisticLockProtected()- Specified by:
isOptimisticLockProtectedin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
requiresFlushAfterPersist
- Specified by:
requiresFlushAfterPersistin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
requiresDeferredFlush
- Specified by:
requiresDeferredFlushin interfaceDirtyAttributeFlusher<X extends AbstractPluralAttributeFlusher<X,A, R, E, V>, A, R>
-
persistOrMerge
protected final <X> X persistOrMerge(javax.persistence.EntityManager em, X object) -
persistOrMerge
protected final <X> X persistOrMerge(javax.persistence.EntityManager em, X object, TypeDescriptor typeDescriptor) -
persistIfNeeded
protected final void persistIfNeeded(javax.persistence.EntityManager em, Object object, BasicUserType<Object> basicUserType) -
mergeCollectionElements
protected abstract boolean mergeCollectionElements(UpdateContext context, Object ownerView, Object view, E entity, V value) -
replaceCollection
protected abstract void replaceCollection(UpdateContext context, Object ownerView, Object view, E entity, V value, FlushStrategy flushStrategy) -
isIndexed
protected abstract boolean isIndexed() -
addFlatViewElementFlushActions
protected abstract void addFlatViewElementFlushActions(UpdateContext context, TypeDescriptor elementDescriptor, List<A> actions, V current) -
getViewElement
protected static Object getViewElement(UpdateContext context, TypeDescriptor typeDescriptor, Object jpaCollectionObject) -
identityContains
protected static boolean identityContains(Collection<Object> addedElements, MutableStateTrackable element) -
getElementOnlyFlusher
protected final DirtyAttributeFlusher<X,E, getElementOnlyFlusherV> (UpdateContext context, V current) -
getReplaceOrMergeOnlyFlusher
protected final DirtyAttributeFlusher<X,E, getReplaceOrMergeOnlyFlusherV> (UpdateContext context, V initial, V current) -
getReplaceOrMergeAndElementFlusher
protected final DirtyAttributeFlusher<X,E, getReplaceOrMergeAndElementFlusherV> (UpdateContext context, V initial, V current) -
getReplayOnlyFlusher
protected final DirtyAttributeFlusher<X,E, getReplayOnlyFlusherV> (UpdateContext context, V initial, V current, List<? extends A> collectionActions) -
getReplayAndElementFlusher
protected final DirtyAttributeFlusher<X,E, getReplayAndElementFlusherV> (UpdateContext context, V initial, V current, List<? extends A> collectionActions, List<CollectionElementAttributeFlusher<E, V>> elementFlushers) -
getElementFlushers
protected abstract List<CollectionElementAttributeFlusher<E,V>> getElementFlushers(UpdateContext context, V current, List<? extends A> actions) -
determineElementFlushers
protected final boolean determineElementFlushers(UpdateContext context, TypeDescriptor typeDescriptor, List<CollectionElementAttributeFlusher<E, V>> elementFlushers, Iterable<?> values, List<? extends A> actions, V current) -
canFlushSeparateCollectionOperations
protected abstract boolean canFlushSeparateCollectionOperations() -
createPersistFlusher
protected abstract CollectionElementAttributeFlusher<E,V> createPersistFlusher(TypeDescriptor typeDescriptor, Object element) -
createMergeFlusher
protected abstract CollectionElementAttributeFlusher<E,V> createMergeFlusher(TypeDescriptor typeDescriptor, Object element) -
partialFlusher
protected abstract AbstractPluralAttributeFlusher<X,A, partialFlusherR, E, V> (boolean fetch, AbstractPluralAttributeFlusher.PluralFlushOperation operation, List<? extends A> collectionActions, List<CollectionElementAttributeFlusher<E, V>> elementFlushers) -
collectionEquals
-
getDirtyFlusherForRecordingCollection
protected abstract DirtyAttributeFlusher<X,E, getDirtyFlusherForRecordingCollectionV> (UpdateContext context, R collection)
-