Class RecursiveWorkingCopier<T>
java.lang.Object
software.xdev.spring.data.eclipse.store.repository.support.copier.working.RecursiveWorkingCopier<T>
- All Implemented Interfaces:
WorkingCopier<T>
Creates copies and puts them back. Recognizes already persisted Objects and checks them for changes as well.
-
Constructor Summary
ConstructorsConstructorDescriptionRecursiveWorkingCopier(Class<T> domainClass, WorkingCopyRegistry registry, IdManagerProvider idManagerProvider, VersionManagerProvider versionManagerProvider, PersistableChecker persistableChecker, SupportedChecker supportedChecker, org.eclipse.serializer.reference.ObjectSwizzling objectSwizzling, jakarta.validation.Validator validator, org.eclipse.serializer.reflect.ClassLoaderProvider currentClassLoaderProvider) -
Method Summary
Modifier and TypeMethodDescription<L extends Collection<T>>
Lcopy(L objectCollectionToCopy) Creates new instances of each element of the given collection and registers it in theWorkingCopyRegistry.Creates a new instance of the given object and registers it in theWorkingCopyRegistry.voidderegister(T workingCopy) Unregister the working copy object from theWorkingCopyRegistry.<E> EgetOrCreateObjectForDatastore(E workingCopy, boolean mergeValues, MergedTargetsCollector alreadyMergedTargets, ChangedObjectCollector changedCollector) getOriginal(T workingCopy) Merges the values of the given object back into the original object from the date store.<E> EonlyCreateCopy(E objectToCopy, boolean invertRegistry)
-
Constructor Details
-
RecursiveWorkingCopier
public RecursiveWorkingCopier(Class<T> domainClass, WorkingCopyRegistry registry, IdManagerProvider idManagerProvider, VersionManagerProvider versionManagerProvider, PersistableChecker persistableChecker, SupportedChecker supportedChecker, org.eclipse.serializer.reference.ObjectSwizzling objectSwizzling, jakarta.validation.Validator validator, org.eclipse.serializer.reflect.ClassLoaderProvider currentClassLoaderProvider)
-
-
Method Details
-
copy
Description copied from interface:WorkingCopierCreates a new instance of the given object and registers it in theWorkingCopyRegistry.- Specified by:
copyin interfaceWorkingCopier<T>- Returns:
- new instance of the object
-
copy
Description copied from interface:WorkingCopierCreates new instances of each element of the given collection and registers it in theWorkingCopyRegistry.- Specified by:
copyin interfaceWorkingCopier<T>- Returns:
- new collection with new instances
-
mergeBack
Description copied from interface:WorkingCopierMerges the values of the given object back into the original object from the date store.- Specified by:
mergeBackin interfaceWorkingCopier<T>- Parameters:
workingCopy- to merge back into the original object- Returns:
- all the changed objects that must get stored
-
getOrCreateObjectForDatastore
public <E> E getOrCreateObjectForDatastore(E workingCopy, boolean mergeValues, MergedTargetsCollector alreadyMergedTargets, ChangedObjectCollector changedCollector) -
getOriginal
- Specified by:
getOriginalin interfaceWorkingCopier<T>- Returns:
- the original entity that corresponds to the given working copy object.
-
onlyCreateCopy
public <E> E onlyCreateCopy(E objectToCopy, boolean invertRegistry) - Specified by:
onlyCreateCopyin interfaceWorkingCopier<T>
-
deregister
Description copied from interface:WorkingCopierUnregister the working copy object from theWorkingCopyRegistry.- Specified by:
deregisterin interfaceWorkingCopier<T>
-