public class DbPersister<T extends Model> extends BasePersister<T>
Constructor and Description |
---|
DbPersister() |
Modifier and Type | Method and Description |
---|---|
void |
attachWatcher()
Attach any file system watchers for changed objects
|
protected boolean |
checkNeedsSync() |
List<T> |
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() |
protected String |
getBucketSyncedKey() |
protected String |
getTableName() |
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 |
onPreRead()
Called before any read operation.
|
void |
persist(T obj)
Persist the object to the underlying data store
|
protected boolean |
syncFromDatabase() |
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
|
getBucket, getItemController, getModelClass, getStash, handleFetchOne, onFetchOne, reloadIfNewer, setBucket, setItemController, setModelClass, setStash
public DbPersister()
public void init(DataAccessRegistration registration, ModelController<T> controller, Stash<T> stash)
Persister
public List<T> fetchAll()
Persister
public T fetchOne(Long id)
Persister
public T fetchOne(T obj)
Persister
public void watchEventCallback(String relativePath)
Persister
public void persist(T obj)
Persister
public void update(T obj, Map<String,Object> values)
Persister
public void hardDelete(T obj)
Persister
public void attachWatcher()
Persister
public boolean isDbBacked()
isDbBacked
in interface Persister<T extends Model>
isDbBacked
in class BasePersister<T extends Model>
public void onPreRead()
Persister
public FilterChain<T> filterChain()
protected boolean syncFromDatabase()
protected String getBucketSyncedKey()
protected boolean checkNeedsSync()
protected String getTableName()
Copyright © 2016. All rights reserved.