T - the entity class related to this controller.K - the type of the field that represents the entity class' primary key.public interface ReadableController<T,K extends Serializable>
| Modifier and Type | Method and Description |
|---|---|
long |
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,
br.com.arsmachina.dao.SortCriterion... sortConstraints)
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.
|
T |
reattach(T object)
Reattaches an object to the persistence context, if there is one.
|
T |
refresh(T object)
Refreshes an object, getting the most recent version of its data from the object store.
|
long countAll()
int.T findById(K id)
id - a K.T.List<T> findAll()
List of T.List<T> findByIds(K... ids)
ids - a K array.List of T.List<T> findByExample(T example)
example - a T.List of T.List<T> findAll(int firstResult, int maxResults, br.com.arsmachina.dao.SortCriterion... sortConstraints)
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.sortConstraints - an SortConstraint array used to define how the returned list
will be sorted.List of T.T reattach(T object)
object - a T.T.T refresh(T object)
object - a TT, which may or may not be the same object passed in the parameter.Copyright © 2008-2013 Ars Machina Tecnologia da Informação Ltda.. All Rights Reserved.