public static class GenericModel.JPAQuery
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
javax.persistence.Query |
query |
java.lang.String |
sq |
Constructor and Description |
---|
JPAQuery(javax.persistence.Query query) |
JPAQuery(java.lang.String sq,
javax.persistence.Query query) |
Modifier and Type | Method and Description |
---|---|
GenericModel.JPAQuery |
bind(java.lang.String name,
java.lang.Object param)
Bind a JPQL named parameter to the current query.
|
<T> java.util.List<T> |
fetch()
Retrieve all results of the query
|
<T> java.util.List<T> |
fetch(int max)
Retrieve results of the query
|
<T> java.util.List<T> |
fetch(int page,
int length)
Retrieve a page of result
|
<T> T |
first() |
<T> GenericModel.JPAQuery |
from(int position)
Set the position to start
|
GenericModel.JPAQuery |
setParameter(java.lang.String name,
java.lang.Object param)
Set a named parameter for this query.
|
public JPAQuery(java.lang.String sq, javax.persistence.Query query)
public JPAQuery(javax.persistence.Query query)
public <T> T first()
public GenericModel.JPAQuery bind(java.lang.String name, java.lang.Object param)
name
- name of the objectparam
- current querypublic GenericModel.JPAQuery setParameter(java.lang.String name, java.lang.Object param)
name
- Parameter nameparam
- The given parameterspublic <T> java.util.List<T> fetch()
T
- the type of the entitypublic <T> java.util.List<T> fetch(int max)
T
- The entity classmax
- Max results to fetchpublic <T> GenericModel.JPAQuery from(int position)
T
- The entity classposition
- Position of the first elementpublic <T> java.util.List<T> fetch(int page, int length)
T
- The entity classpage
- Page number (start at 1)length
- (page length)Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly