|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tynamo.jpa.internal.JPAGridDataSource<E>
E - public class JPAGridDataSource<E>
A simple implementation of GridDataSource based on a Hibernate
Session and a known entity class. This implementation does support multiple
sort constraints; however it assumes a direct
mapping from sort constraint property to Hibernate property.
| Field Summary | |
|---|---|
protected javax.persistence.EntityManager |
entityManager
|
| Constructor Summary | |
|---|---|
JPAGridDataSource(javax.persistence.EntityManager em,
Class<E> entityType)
|
|
| Method Summary | |
|---|---|
protected javax.persistence.criteria.Expression<Boolean> |
additionalConstraints(javax.persistence.criteria.CriteriaBuilder cb,
javax.persistence.criteria.Root<E> root)
Invoked after the main criteria has been set up (firstResult, maxResults and any sort contraints). |
int |
getAvailableRows()
Returns the total number of rows for the configured entity type. |
Class |
getRowType()
Returns the entity type, as provided via the constructor. |
Object |
getRowValue(int index)
Returns a row value at the given index (which must be within the range defined by the call to prepare(int, int, java.util.List) ). |
void |
prepare(int startIndex,
int endIndex,
List<org.apache.tapestry5.grid.SortConstraint> sortConstraints)
Prepares the results, performing a query (applying the sort results, and the provided start and end index). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final javax.persistence.EntityManager entityManager
| Constructor Detail |
|---|
public JPAGridDataSource(javax.persistence.EntityManager em,
Class<E> entityType)
| Method Detail |
|---|
public int getAvailableRows()
getAvailableRows in interface org.apache.tapestry5.grid.GridDataSource
public void prepare(int startIndex,
int endIndex,
List<org.apache.tapestry5.grid.SortConstraint> sortConstraints)
getRowValue(int) .
prepare in interface org.apache.tapestry5.grid.GridDataSourcestartIndex - index, from zero, of the first item to be retrievedendIndex - index, from zero, of the last item to be retrievedsortConstraints - zero or more constraints used to set the order of the returned values
protected javax.persistence.criteria.Expression<Boolean> additionalConstraints(javax.persistence.criteria.CriteriaBuilder cb,
javax.persistence.criteria.Root<E> root)
public Object getRowValue(int index)
prepare(int, int, java.util.List) ).
getRowValue in interface org.apache.tapestry5.grid.GridDataSourceindex - of object
public Class getRowType()
getRowType in interface org.apache.tapestry5.grid.GridDataSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||