T
- public interface Persister<T extends Model>
Modifier and Type | Method and Description |
---|---|
void |
attachWatcher()
Attach any file system watchers for changed objects
|
List |
fetchAll()
Fetch all the items from the underlying data store.
|
T |
fetchOne(Long id)
Fetch one object with the given ID
|
T |
fetchOne(T obj)
Re-fetch the passed in object from the underlying data stores
|
FilterChain<T> |
filterChain() |
String |
getBucket()
The bucket name associated with this persister.
|
ModelController<T> |
getItemController()
Get the controller associated with this persister
|
Class<T> |
getModelClass()
The Class of the model associated with this persister
|
Stash<T> |
getStash()
Get the Stash associated with this persister
|
void |
handleFetchOne(T obj)
Called by fetchOne() after the object has been loaded from the datastore
|
void |
hardDelete(T obj)
Permanently delete the object from the datastore
|
void |
init(DataAccessRegistration registration,
ModelController<T> controller,
Stash<T> stash)
Initialize the persister, called during DalRegistery.register
|
boolean |
isDbBacked() |
void |
onFetchOne()
Called after an object has been fetched from the data store
|
void |
onPreRead()
Called before any read operation.
|
void |
persist(T obj)
Persist the object to the underlying data store
|
boolean |
reloadIfNewer(T obj)
Reload the object if the version in the datastore is more recent than the
local object
|
Persister<T> |
setBucket(String bucket) |
Persister |
setItemController(ModelController<T> controller) |
Persister<T> |
setModelClass(Class<T> modelClass) |
Persister<T> |
setStash(Stash<T> stash) |
default void |
update(T obj,
Map<String,Object> values)
Update the specified values.
|
void |
watchEventCallback(String relativePath)
Callback for file-based datastores when an object is changed in the file system
|
void init(DataAccessRegistration registration, ModelController<T> controller, Stash<T> stash)
registration
- controller
- stash
- Class<T> getModelClass()
Persister<T> setModelClass(Class<T> modelClass)
T fetchOne(T obj)
obj
- ModelController<T> getItemController()
Persister setItemController(ModelController<T> controller)
void watchEventCallback(String relativePath)
relativePath
- default void update(T obj, Map<String,Object> values)
obj
- values
- void hardDelete(T obj)
obj
- void attachWatcher()
void handleFetchOne(T obj)
obj
- void onFetchOne()
void onPreRead()
boolean reloadIfNewer(T obj)
obj
- FilterChain<T> filterChain()
boolean isDbBacked()
Copyright © 2016. All rights reserved.