public abstract class BasePersister<T extends Model> extends Object implements Persister<T>
Constructor and Description |
---|
BasePersister() |
Modifier and Type | Method and Description |
---|---|
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 |
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.
|
boolean |
reloadIfNewer(T obj)
Reload the object if the version in the datastore is more recent than the
local object
|
Persister |
setBucket(String bucket) |
Persister<T> |
setItemController(ModelController<T> controller) |
Persister<T> |
setModelClass(Class<T> modelClass) |
BasePersister |
setStash(Stash<T> stash) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attachWatcher, fetchAll, fetchOne, fetchOne, filterChain, hardDelete, persist, update, watchEventCallback
public BasePersister()
public void init(DataAccessRegistration registration, ModelController<T> controller, Stash<T> stash)
Persister
public Class<T> getModelClass()
Persister
getModelClass
in interface Persister<T extends Model>
public Persister<T> setModelClass(Class<T> modelClass)
setModelClass
in interface Persister<T extends Model>
public boolean isDbBacked()
isDbBacked
in interface Persister<T extends Model>
public String getBucket()
Persister
public ModelController<T> getItemController()
Persister
getItemController
in interface Persister<T extends Model>
public Persister<T> setItemController(ModelController<T> controller)
setItemController
in interface Persister<T extends Model>
public Stash<T> getStash()
Persister
public BasePersister setStash(Stash<T> stash)
public void onPreRead()
Persister
public void handleFetchOne(T obj)
Persister
handleFetchOne
in interface Persister<T extends Model>
public boolean reloadIfNewer(T obj)
Persister
reloadIfNewer
in interface Persister<T extends Model>
public void onFetchOne()
Persister
onFetchOne
in interface Persister<T extends Model>
Copyright © 2016. All rights reserved.