|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GenericDao<T,PK extends java.io.Serializable>
Interface for generic CRUD operations on a DAO for a specific type.
| Method Summary | |
|---|---|
java.lang.Long |
count()
Returns the number of entities available. |
void |
delete(java.util.List<T> entities)
Deletes the given entities. |
void |
delete(T entity)
Deletes a given entity. |
void |
deleteAll()
Deletes all entities managed by the DAO. |
boolean |
exists(PK primaryKey)
Returns whether an entity with the given id exists. |
void |
flush()
Flushes all pending changes to the database. |
java.util.List<T> |
readAll()
Returns all instances of the type. |
Page<T> |
readAll(Pageable pageable)
Returns a paged list of entities meeting the paging restriction provided in the Pageable object. |
java.util.List<T> |
readAll(Sort sort)
Returns all entities sorted by the given options. |
T |
readByPrimaryKey(PK primaryKey)
Retrives an entity by it's primary key. |
java.util.List<T> |
save(java.util.List<T> entities)
|
T |
save(T entity)
Saves a given entity. |
T |
saveAndFlush(T entity)
Saves an entity and flushes changes instantly to the database. |
| Method Detail |
|---|
T save(T entity)
entity -
java.util.List<T> save(java.util.List<T> entities)
entities -
T saveAndFlush(T entity)
entity -
T readByPrimaryKey(PK primaryKey)
primaryKey -
null if none
found
java.lang.IllegalArgumentException - if primaryKey is nullboolean exists(PK primaryKey)
primaryKey -
java.lang.IllegalArgumentException - if primaryKey is nulljava.util.List<T> readAll()
java.util.List<T> readAll(Sort sort)
sort -
Page<T> readAll(Pageable pageable)
Pageable object.
pageable -
java.lang.Long count()
void delete(T entity)
entity - void delete(java.util.List<T> entities)
entities - void deleteAll()
void flush()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||