T
- a type variablePK
- the primary key for that typepublic interface GenericDao<T,PK extends Serializable>
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 |
remove(PK id)
Generic method to delete an object based on class and id
|
T |
save(T object)
Generic method to save an object - handles both update and insert.
|
List<T> getAll()
T get(PK id)
id
- the identifier (primary key) of the object to getObjectRetrievalFailureException
boolean exists(PK id)
id
- the id of the entityT save(T object)
object
- the object to savevoid remove(PK id)
id
- the identifier (primary key) of the object to removeCopyright © 2015. All rights reserved.