T - a type variablePK - the primary key for that typepublic interface GenericManager<T,PK extends Serializable>
Extend this interface if you want typesafe (no casting necessary) managers for your domain objects.
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists(PK id)
Checks for existence of an object of type T using the id arg.
|
T |
get(PK id)
Generic method to get an object based on class and identifier.
|
List<T> |
getAll()
Generic method used to get all objects of a particular type.
|
void |
reindex()
Generic method to regenerate full text index of the persistent class T
|
void |
reindexAll(boolean async)
Generic method to regenerate full text index of all indexed classes
|
void |
remove(PK id)
Generic method to delete an object based on class and id
|
void |
remove(T object)
Generic method to delete an object
|
T |
save(T object)
Generic method to save an object - handles both update and insert.
|
List<T> |
search(String searchTerm,
Class clazz)
Generic method to search for an object.
|
List<T> getAll()
T get(PK id)
id - the identifier (primary key) of the object to getObjectRetrievalFailureExceptionboolean exists(PK id)
id - the identifier (primary key) of the object to getT save(T object)
object - the object to savevoid remove(T object)
object - the object to removevoid remove(PK id)
id - the identifier (primary key) of the object to removeList<T> search(String searchTerm, Class clazz)
searchTerm - the search termclazz - type of class to search for.void reindex()
void reindexAll(boolean async)
async - true to perform the reindexing asynchronouslyCopyright © 2003-2012. All Rights Reserved.