Package org.apache.openjpa.util
Interface ChangeTracker
- All Known Subinterfaces:
CollectionChangeTracker
,MapChangeTracker
- All Known Implementing Classes:
AbstractChangeTracker
,AbstractLRSProxyCollection
,AbstractLRSProxyMap
,CollectionChangeTrackerImpl
,DelayedCollectionChangeTrackerImpl
,LRSProxyCollection
,MapChangeTrackerImpl
public interface ChangeTracker
Interface for components that track changes to containers at a
fine-grained level. Proxies that use change trackers might have better
update performance than non-tracking proxies.
- Author:
- Abe White
-
Method Summary
Modifier and TypeMethodDescriptiongetAdded()
Return the collection of values that need to be added to the managed container.Return the set of elements that have changed.int
The next element sequence value for this proxy at load time.Return the set of values that need to be removed from the managed container.boolean
Return true if this tracker has an up-to-date view of all the changes to the container it is managing.void
setNextSequence
(int seq) The maximum element sequence value for this proxy at load time.void
Reset the state of the change tracker, and turn change tracking back on if it has been disabled.void
Tell the tracker to stop tracking changes for its container.
-
Method Details
-
isTracking
boolean isTracking()Return true if this tracker has an up-to-date view of all the changes to the container it is managing. -
startTracking
void startTracking()Reset the state of the change tracker, and turn change tracking back on if it has been disabled. -
stopTracking
void stopTracking()Tell the tracker to stop tracking changes for its container. -
getAdded
Collection getAdded()Return the collection of values that need to be added to the managed container. -
getRemoved
Collection getRemoved()Return the set of values that need to be removed from the managed container. -
getChanged
Collection getChanged()Return the set of elements that have changed. In maps, this marks a possible change in value for a key. In collections, this marks an element that has been removed and re-added. -
getNextSequence
int getNextSequence()The next element sequence value for this proxy at load time. If the data store keeps this proxy's data in sequence order but allows holes for removed objects, the implementation can set the next sequence at load time, then retrieve it and start from there for added objects at flush time. This value is set back to 0 if the proxy stops tracking changes. For ordered proxies, it is set to the proxy's size when the proxy starts tracking changes again. -
setNextSequence
void setNextSequence(int seq) The maximum element sequence value for this proxy at load time. If the data store keeps this proxy's data in sequence order but allows holes for removed objects, the implementation can set the next sequence at load time, then retrieve it and start from there for added objects at flush time. This value is set back to 0 if the proxy stops tracking changes. For ordered proxies, it is set to the proxy's size when the proxy starts tracking changes again.
-