Package one.microstream.persistence.util
Interface Reloader
- All Known Implementing Classes:
Reloader.Default
public interface Reloader
Utility to reload objects or object graphs.
Reload means that the in-memory state of the objects is reset to the state of the underlying storage.
Usage:
EmbeddedStorageManager storage = ...; Reloader reloader = Reloader.New(storage.persistenceManager()); reloader.reloadFlat(obj); // reloads only the given object, but not its references reloader.reloadDeep(obj); // reloads the complete object graph
- Since:
- 08.00.00
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Reloader.Default
-
Method Summary
Modifier and Type Method Description static Reloader
New(PersistenceManager<?> persistenceManager)
Pseudo-constructor method to create a newReloader
.<T> T
reloadDeep(T instance)
Resets the state of the given instance and all of its references to the state of the underlying storage.<T> T
reloadFlat(T instance)
Resets the state of the given instance to the state of the underlying storage.
-
Method Details
-
reloadFlat
<T> T reloadFlat(T instance)Resets the state of the given instance to the state of the underlying storage. But not its references.- Type Parameters:
T
- type of the instance- Parameters:
instance
- the object to reload- Returns:
- the reloaded object, or
null
if it was not found in the storage
-
reloadDeep
<T> T reloadDeep(T instance)Resets the state of the given instance and all of its references to the state of the underlying storage.- Type Parameters:
T
- type of the instance- Parameters:
instance
- the object to reload- Returns:
- the reloaded object, or
null
if it was not found in the storage
-
New
Pseudo-constructor method to create a newReloader
.- Parameters:
persistenceManager
- the persistence manager to reload from- Returns:
- a newly created
Reloader
-