|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - Type of handled objectPK - The primary key of the objectpublic interface GenericDAO<T,PK extends Serializable>
Title: GenericDAO
Description: Generic DAO (Data Access Object) containing common methods for object persistence.
| Method Summary | ||
|---|---|---|
void |
clear()
Clears session. |
|
void |
evict(T object)
Evicts given object from session. |
|
boolean |
exists(PK id)
Checks for existence of an object with given key. |
|
void |
flush()
Flushes session. |
|
Collection<T> |
get(Collection<PK> ids)
Generic method to get objects based on class and identifiers. |
|
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. |
|
List<T> |
getByExample(T object)
Gets objects from the database that match given example. |
|
T |
getByUniqueExample(T object)
Gets object from the database that match given example. |
|
PK |
getKey(T object)
Generic method to get the identifier of a given object. |
|
T |
getLast()
Generic method to get the last object. |
|
void |
remove(Collection<T> objects)
Generic method to delete a given object |
|
void |
remove(PK id)
Generic method to delete an object with given id |
|
void |
remove(T object)
Generic method to delete a given object |
|
|
save(C objects)
Generic method to save collection of objects - handles insert, update and remove. |
|
T |
save(T object)
Generic method to save an object - handles insert, update and remove. |
|
void |
setKey(T object,
PK key)
Generic method to set the identifier for a given object. |
|
| Method Detail |
|---|
List<T> getAll()
Exception - When database problems occurT get(PK id)
id - The identifier (primary key) of the object to get
Exception - When database problems occurCollection<T> get(Collection<PK> ids)
ids - The identifiers (primary keys) of the objects to get
Exception - When database problems occurT getLast()
List<T> getByExample(T object)
object - The template object to match (not null columns)
Exception - When database problems occurT getByUniqueExample(T object)
object - The template object to match (not null columns)
Exception - When database problems occurboolean exists(PK id)
id - The id of the entity
Exception - When database problems occurT save(T object)
object - The object to save
Exception - When database problems occur<C extends Collection<T>> C save(C objects)
C - Type of collectionobjects - The objects to save
Exception - When database problems occurvoid remove(T object)
object - The object to remove
Exception - When database problems occurvoid remove(Collection<T> objects)
object - The object to remove
Exception - When database problems occurvoid remove(PK id)
id - The identifier (primary key) of the object to remove
Exception - When database problems occurvoid flush()
void clear()
void evict(T object)
object - PK getKey(T object)
object - The object to get PK for
void setKey(T object,
PK key)
object - The object to get PK forkey - The identifier (primary key) of a given object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||