@ParametersAreNonnullByDefault public class AutoSavingStore extends AbstractStore
Store wrapper that automatically saves modifications as calls are made.| Modifier and Type | Field and Description | 
|---|---|
| static long | DEFAULT_CHUNKThe default number of allowed changes between saves. | 
| Constructor and Description | 
|---|
| AutoSavingStore()Constructs a new  AutoSavingStorewith the default number of modifications between saves. | 
| AutoSavingStore(Long chunk)Constructs a new  AutoSavingStorewith the givenchunk. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addAllReferences(ManyFeatureBean feature,
                List<Id> collection)Adds all the  collectionto the specifiedfeaturefrom the position of thefeature. | 
| <V> void | addAllValues(ManyFeatureBean feature,
            List<? extends V> collection)Adds all the  collectionto the specifiedfeaturefrom the position of thefeature. | 
| void | addReference(ManyFeatureBean feature,
            Id reference)Adds the  referenceto the specifiedfeatureat a defined position. | 
| <V> void | addValue(ManyFeatureBean feature,
        V value)Adds the  valueto the specifiedfeatureat a defined position. | 
| int | appendAllReferences(SingleFeatureBean feature,
                   List<Id> collection)Adds all the  collectionto the specifiedfeaturefrom the last position. | 
| <V> int | appendAllValues(SingleFeatureBean feature,
               List<? extends V> collection)Adds all the  collectionto the specifiedfeaturefrom the last position. | 
| int | appendReference(SingleFeatureBean feature,
               Id reference)Adds the  referenceto the specifiedfeatureat the last position. | 
| <V> int | appendValue(SingleFeatureBean feature,
           V value)Adds the  valueto the specifiedfeatureat the last position. | 
| void | close()
 
 Cleanly closes this manager, clear all data in-memory and releases any system resources associated with it. | 
| void | containerFor(Id id,
            SingleFeatureBean container)Stores the  containerfor the specifiedid. | 
| boolean | metaClassFor(Id id,
            ClassBean metaClass)Stores the  metaClassfor the specifiedid. | 
| Optional<Id> | referenceFor(ManyFeatureBean feature,
            Id reference)Defines the  referenceof the specifiedfeatureat a defined position. | 
| Optional<Id> | referenceFor(SingleFeatureBean feature,
            Id reference)Defines the reference of the specified  feature. | 
| void | removeAllReferences(SingleFeatureBean feature)Removes all references of the specified  feature. | 
| void | removeAllValues(SingleFeatureBean feature)Removes all values of the specified  feature. | 
| void | removeContainer(Id id)Removes the container of the specified  id. | 
| Optional<Id> | removeReference(ManyFeatureBean feature)Removes the reference of the specified  featureat a defined position. | 
| void | removeReference(SingleFeatureBean feature)Removes the reference of the specified  feature. | 
| <V> Optional<V> | removeValue(ManyFeatureBean feature)Removes the value of the specified  featureat a defined position. | 
| void | removeValue(SingleFeatureBean feature)Removes the value of the specified  feature. | 
| void | save()Saves all changes made on this manager since the last call. | 
| <V> Optional<V> | valueFor(ManyFeatureBean feature,
        V value)Defines the  valueof the specifiedfeatureat a defined position. | 
| <V> Optional<V> | valueFor(SingleFeatureBean feature,
        V value)Defines the  valueof the specifiedfeature. | 
backend, compareTo, equals, hashCode, next, toStringallInstancesOf, allInstancesOf, allReferencesOf, allValuesOf, containerOf, copyTo, metaClassOf, next, referenceOf, referenceOf, sizeOfReference, sizeOfValue, valueOf, valueOfclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainerOfallInstancesOf, allInstancesOf, metaClassOfallValuesOf, sizeOfValue, valueOfvalueOfallReferencesOf, referenceOf, sizeOfReferencereferenceOf@Nonnegative public static final long DEFAULT_CHUNK
public AutoSavingStore(Long chunk)
AutoSavingStore with the given chunk.chunk - the number of modifications between savespublic AutoSavingStore()
AutoSavingStore with the default number of modifications between saves.public void close()
SaveableCleanly closes this manager, clear all data in-memory and releases any system resources associated with it. All modifications are saved before closing.
If the manager is already closed, then invoking this method has no effect.
close in interface Saveableclose in interface Closeableclose in interface AutoCloseableclose in class AbstractDataMapperChain<Store>public void save()
Saveablesave in interface Saveablesave in class AbstractDataMapperChain<Store>public void containerFor(Id id, SingleFeatureBean container)
ContainerMappercontainer for the specified id.containerFor in interface ContainerMappercontainerFor in class AbstractDataMapperChain<Store>id - the Id of the contained elementcontainer - the containing element's container information to storepublic void removeContainer(Id id)
ContainerMapperid.
 
 The container must be completely removed, so that a call to ContainerMapper.containerOf(Id) returns Optional.empty().
removeContainer in interface ContainerMapperremoveContainer in class AbstractDataMapperChain<Store>id - the Id of the contained elementpublic boolean metaClassFor(Id id, ClassBean metaClass)
ClassMappermetaClass for the specified id.metaClassFor in interface ClassMappermetaClassFor in class AbstractDataMapperChain<Store>id - the Id of the elementmetaClass - the containing element's meta-class information to storetrue if the meta-class has been defined, false if the id already has a meta-class@Nonnull public <V> Optional<V> valueFor(SingleFeatureBean feature, V value)
ValueMappervalue of the specified feature.valueFor in interface ValueMappervalueFor in class AbstractDataMapperChain<Store>V - the type of valuefeature - the bean identifying the valuevalue - the value to setOptional containing the previous value of the feature, or Optional.empty() if
 the feature has no value beforepublic void removeValue(SingleFeatureBean feature)
ValueMapperfeature.removeValue in interface ValueMapperremoveValue in class AbstractDataMapperChain<Store>feature - the bean identifying the value@Nonnull public Optional<Id> referenceFor(SingleFeatureBean feature, Id reference)
ReferenceMapperfeature.referenceFor in interface ReferenceMapperreferenceFor in class AbstractDataMapperChain<Store>feature - the bean identifying the referencereference - the reference to setOptional containing the previous reference of the feature, or Optional.empty()
 if the feature has no reference beforepublic void removeReference(SingleFeatureBean feature)
ReferenceMapperfeature.removeReference in interface ReferenceMapperremoveReference in class AbstractDataMapperChain<Store>feature - the bean identifying the reference@Nonnull public <V> Optional<V> valueFor(ManyFeatureBean feature, V value)
ManyValueMappervalue of the specified feature at a defined position.valueFor in interface ManyValueMappervalueFor in class AbstractDataMapperChain<Store>V - the type of valuefeature - the bean identifying the multi-valued attributevalue - the value to setOptional containing the previous value of the feature, or Optional.empty() if
 the feature has no value beforeManyValueMapper.addValue(ManyFeatureBean, Object), 
ManyValueMapper.appendValue(SingleFeatureBean, Object)public <V> void addValue(ManyFeatureBean feature, V value)
ManyValueMappervalue to the specified feature at a defined position.addValue in interface ManyValueMapperaddValue in class AbstractDataMapperChain<Store>V - the type of valuefeature - the bean identifying the multi-valued attributevalue - the value to addpublic <V> void addAllValues(ManyFeatureBean feature, List<? extends V> collection)
ManyValueMappercollection to the specified feature from the position of the feature.addAllValues in interface ManyValueMapperaddAllValues in class AbstractDataMapperChain<Store>V - the type of valuefeature - the bean identifying the multi-valued attributecollection - the values to add@Nonnegative public <V> int appendValue(SingleFeatureBean feature, V value)
ManyValueMappervalue to the specified feature at the last position.appendValue in interface ManyValueMapperappendValue in class AbstractDataMapperChain<Store>V - the type of valuefeature - the bean identifying the multi-valued attributevalue - the value to addManyValueMapper.addValue(ManyFeatureBean, Object)@Nonnegative public <V> int appendAllValues(SingleFeatureBean feature, List<? extends V> collection)
ManyValueMappercollection to the specified feature from the last position.appendAllValues in interface ManyValueMapperappendAllValues in class AbstractDataMapperChain<Store>V - the type of valuesfeature - the bean identifying the multi-valued attributecollection - the values to addManyValueMapper.addValue(ManyFeatureBean, Object), 
ManyValueMapper.appendValue(SingleFeatureBean, Object)@Nonnull public <V> Optional<V> removeValue(ManyFeatureBean feature)
ManyValueMapperfeature at a defined position.removeValue in interface ManyValueMapperremoveValue in class AbstractDataMapperChain<Store>V - the type of valuefeature - the bean identifying the multi-valued attributeOptional containing the removed value, or Optional.empty() if the feature has no value
 beforepublic void removeAllValues(SingleFeatureBean feature)
ManyValueMapperfeature.removeAllValues in interface ManyValueMapperremoveAllValues in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued attribute@Nonnull public Optional<Id> referenceFor(ManyFeatureBean feature, Id reference)
ManyReferenceMapperreference of the specified feature at a defined position.referenceFor in interface ManyReferenceMapperreferenceFor in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued referencereference - the reference to setOptional containing the previous reference of the feature, or Optional.empty()
 if the feature has no reference beforeManyReferenceMapper.addReference(ManyFeatureBean, Id), 
ManyReferenceMapper.appendReference(SingleFeatureBean, Id)public void addReference(ManyFeatureBean feature, Id reference)
ManyReferenceMapperreference to the specified feature at a defined position.addReference in interface ManyReferenceMapperaddReference in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued referencereference - the reference to addpublic void addAllReferences(ManyFeatureBean feature, List<Id> collection)
ManyReferenceMappercollection to the specified feature from the position of the feature.addAllReferences in interface ManyReferenceMapperaddAllReferences in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued attributecollection - the values to add@Nonnegative public int appendReference(SingleFeatureBean feature, Id reference)
ManyReferenceMapperreference to the specified feature at the last position.appendReference in interface ManyReferenceMapperappendReference in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued referencereference - the reference to addManyReferenceMapper.addReference(ManyFeatureBean, Id)@Nonnegative public int appendAllReferences(SingleFeatureBean feature, List<Id> collection)
ManyReferenceMappercollection to the specified feature from the last position.appendAllReferences in interface ManyReferenceMapperappendAllReferences in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued referencecollection - the references to addManyReferenceMapper.addReference(ManyFeatureBean, Id), 
ManyReferenceMapper.appendReference(SingleFeatureBean, Id)@Nonnull public Optional<Id> removeReference(ManyFeatureBean feature)
ManyReferenceMapperfeature at a defined position.removeReference in interface ManyReferenceMapperremoveReference in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued referenceOptional containing the removed reference, or Optional.empty() if the feature has no
 reference beforepublic void removeAllReferences(SingleFeatureBean feature)
ManyReferenceMapperfeature.removeAllReferences in interface ManyReferenceMapperremoveAllReferences in class AbstractDataMapperChain<Store>feature - the bean identifying the multi-valued referenceCopyright © 2013–2019 Atlanmod. All rights reserved.