T - the type of the domain entityPK - the type of the primary key from the domain entitypublic interface GenericDao<T extends BaseEntity<PK>,PK extends Serializable> extends Serializable
GenericDao provide an API for database operations like insert, delete,
update and selections.| Modifier and Type | Method and Description |
|---|---|
void |
delete(List<T> entities)
Delete all persistent entities in the given list.
|
void |
delete(PK id)
Deletes an entity of a given Id.
|
void |
delete(T entity)
Deletes the given entity from persistent storage in the database.
|
void |
evict(T entity)
Remove this instance from the session cache.
|
boolean |
exists(PK id)
Checks if an entry exists with the given id.
|
List<T> |
findAll()
Returns a list of all persistent entities.
|
T |
get(PK id)
Retrieve a persisted entity with a given id from the database.
|
Class<T> |
getType()
Gets the class type.
|
T |
load(PK id)
Retrieve a persisted entity with a given id from the database.
|
List<T> |
merge(List<T> entities)
Merges all new entities in the given list.
|
T |
merge(T entity)
Merges the given entity.
|
void |
refresh(T entity)
Re-read the state of the given instance from the underlying database.
|
List<PK> |
save(List<T> entities)
Save all new entities in the given list.
|
PK |
save(T entity)
Persist the given entity into database.
|
void |
saveOrUpdate(List<T> entities)
Save or update all transient entities in the given list.
|
void |
saveOrUpdate(T entity)
Save or update the given persistent entity.
|
void |
update(List<T> entities)
Update all transient entities in the given list.
|
void |
update(T entity)
Update changes made to the given entity.
|
void delete(List<T> entities)
entities - the list with the persistent entities to deletevoid delete(PK id)
id - the idvoid delete(T entity)
entity - the persistent entityvoid evict(T entity)
entity - the entity to evict.boolean exists(PK id)
id - the id to checkList<T> findAll()
T get(PK id)
id - the idT load(PK id)
id - the idList<T> merge(List<T> entities)
entities - the list to saveT merge(T entity)
entity - the entityvoid refresh(T entity)
entity - the entity to re-read.List<PK> save(List<T> entities)
entities - the list to savePK save(T entity)
entity - the new instance to save.void saveOrUpdate(List<T> entities)
entities - the transient entitiesvoid saveOrUpdate(T entity)
entity - the transient entity to save or update.void update(List<T> entities)
entities - the transient entities to update.void update(T entity)
entity - the transient entity to update.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.