|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - the entity class related to this DAO.K - the type of the field that represents the entity class' primary key.public interface ReadableDAO<T,K extends Serializable>
Interface that defines a read-only, generic and generified Data Access Object (DAO) for a given entity class.
| Method Summary | |
|---|---|
int |
countAll()
Returns the total number of objects of this class. |
List<T> |
findAll()
Returns the all instances of the related entity class. |
List<T> |
findAll(int firstResult,
int maxResults,
SortCriterion... sortingConstraints)
Returns the all instances of the related entity class, but in a paginated fashion. |
List<T> |
findByExample(T example)
Executes a query by example. |
T |
findById(K id)
Returns the object with a given primary key value. |
List<T> |
findByIds(K... ids)
Returns the objects with some given primary key values. |
SortCriterion[] |
getDefaultSortCriteria()
Returns the default SortCriterions to be used to sort the objects lists returned by
methods like findAll() and findAll(int, int, SortCriterion...) when no
sort constraints are given. |
T |
reattach(T object)
Reattaches an object to the persistence context, if there is one. |
void |
refresh(T object)
Refreshes an object, overwriting its fields with values coming from the object store. |
| Method Detail |
|---|
int countAll()
int.T findById(K id)
id - a K.
T.List<T> findByIds(K... ids)
ids - a K array.
List of T.List<T> findAll()
List of T.List<T> findByExample(T example)
example - a T.
List of T.void refresh(T object)
object - a TT reattach(T object)
object - a T.
T.
List<T> findAll(int firstResult,
int maxResults,
SortCriterion... sortingConstraints)
firstResult - an int with the index of the first object to be returned.
The first object has index 0.maxResults - an int with the maximum number of objects to be returned.sortingConstraints - an SortCriterion array used to define how the returned
list will be sorted.
List of T.SortCriterion[] getDefaultSortCriteria()
SortCriterions to be used to sort the objects lists returned by
methods like findAll() and findAll(int, int, SortCriterion...) when no
sort constraints are given.
SortCriterion array. It cannot be null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||