T
- public class NoStash<T extends Model> extends StashBase<T>
Constructor and Description |
---|
NoStash() |
Modifier and Type | Method and Description |
---|---|
int |
countForKey(String keyName,
Object value)
Count the number of objects associated with an alternative key
|
T |
detach(T obj)
Return a cloned version of the object.
|
FilterChain<T> |
filterByKey(String key,
Object lookupValue)
Create a new filterChain, restricting it to items matching the lookupValue for the key
|
FilterChain<T> |
filterChain()
Create a new FilterChain for this stash
|
FilterChain<T> |
filterChain(List<T> subset)
Create a new filter chain using a subset of items
|
T |
forId(Long id)
Get a cloned/detached object by id
|
T |
forUniqueKey(String keyName,
Object value)
Retrieve an object via unique key.
|
List<T> |
getItems()
All the items in the stash.
|
void |
hardDelete(T obj)
Remove the object from the stash and the underlying data store
|
List<T> |
listForKey(String keyName,
Object value)
Retrieve all objects for a given alternative key
|
void |
loadAll()
Load all items from the datastore into the stash.
|
void |
loadForId(Long id)
Load or reload the item with the given id from the datastore into the stash
|
boolean |
loadItem(T obj)
Re-load the given object from the datastore into the stash
|
void |
onPreRead()
Called before any of the data access methods run
|
T |
originalForId(Long id)
Get the original object by id, if modified, the object in the stash
will be modified, so be careful.
|
void |
reset()
Reset the cache, nulling out all existing fields, and then reloading everything from
the database.
|
void |
save(T obj)
Save the object to the stash and the underlying data store
|
void |
sync(T obj)
Take the passed in object, find the object in the stash with the same id, and
sync the data of the passed in object to the stashed object.
|
getBucket, getController, getKeyFields, getPersister, getUniqueFields, init, reloadIfNewer, setKeyFields, setUniqueFields, syncForSave
public NoStash()
public void sync(T obj)
Stash
public T detach(T obj)
Stash
public void save(T obj)
Stash
public void hardDelete(T obj)
Stash
hardDelete
in class Stash<T extends Model>
public void loadAll()
Stash
public boolean loadItem(T obj)
Stash
public void loadForId(Long id)
Stash
public void reset()
Stash
public void onPreRead()
Stash
public T forId(Long id)
Stash
public T originalForId(Long id)
Stash
originalForId
in class Stash<T extends Model>
public T forUniqueKey(String keyName, Object value)
Stash
forUniqueKey
in class Stash<T extends Model>
public List<T> listForKey(String keyName, Object value)
Stash
listForKey
in class Stash<T extends Model>
public int countForKey(String keyName, Object value)
Stash
countForKey
in class Stash<T extends Model>
public FilterChain<T> filterChain()
Stash
filterChain
in class Stash<T extends Model>
public FilterChain<T> filterByKey(String key, Object lookupValue)
Stash
filterByKey
in class Stash<T extends Model>
key
- - a model field that has been defined as a keypublic FilterChain<T> filterChain(List<T> subset)
Stash
filterChain
in class Stash<T extends Model>
Copyright © 2016. All rights reserved.