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, syncForSavepublic NoStash()
public void sync(T obj)
Stashpublic T detach(T obj)
Stashpublic void save(T obj)
Stashpublic void hardDelete(T obj)
StashhardDelete in class Stash<T extends Model>public void loadAll()
Stashpublic boolean loadItem(T obj)
Stashpublic void loadForId(Long id)
Stashpublic void reset()
Stashpublic void onPreRead()
Stashpublic T forId(Long id)
Stashpublic T originalForId(Long id)
StashoriginalForId in class Stash<T extends Model>public T forUniqueKey(String keyName, Object value)
StashforUniqueKey in class Stash<T extends Model>public List<T> listForKey(String keyName, Object value)
StashlistForKey in class Stash<T extends Model>public int countForKey(String keyName, Object value)
StashcountForKey in class Stash<T extends Model>public FilterChain<T> filterChain()
StashfilterChain in class Stash<T extends Model>public FilterChain<T> filterByKey(String key, Object lookupValue)
StashfilterByKey in class Stash<T extends Model>key - - a model field that has been defined as a keypublic FilterChain<T> filterChain(List<T> subset)
StashfilterChain in class Stash<T extends Model>Copyright © 2016. All rights reserved.