play.db.jpa
Class GenericModel.JPAQuery

java.lang.Object
  extended by play.db.jpa.GenericModel.JPAQuery
Direct Known Subclasses:
JPASupport.JPAQuery
Enclosing class:
GenericModel

public static class GenericModel.JPAQuery
extends java.lang.Object

A JPAQuery


Field Summary
 Query query
           
 java.lang.String sq
           
 
Constructor Summary
GenericModel.JPAQuery(Query query)
           
GenericModel.JPAQuery(java.lang.String sq, Query query)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

query

public Query query

sq

public java.lang.String sq
Constructor Detail

GenericModel.JPAQuery

public GenericModel.JPAQuery(java.lang.String sq,
                             Query query)

GenericModel.JPAQuery

public GenericModel.JPAQuery(Query query)
Method Detail

first

public <T> T first()

bind

public GenericModel.JPAQuery bind(java.lang.String name,
                                  java.lang.Object param)
Bind a JPQL named parameter to the current query.


fetch

public <T> java.util.List<T> fetch()
Retrieve all results of the query

Returns:
A list of entities

fetch

public <T> java.util.List<T> fetch(int max)
Retrieve results of the query

Parameters:
max - Max results to fetch
Returns:
A list of entities

from

public <T> GenericModel.JPAQuery from(int position)
Set the position to start

Parameters:
position - Position of the first element
Returns:
A new query

fetch

public <T> java.util.List<T> fetch(int page,
                                   int length)
Retrieve a page of result

Parameters:
page - Page number (start at 1)
length - (page length)
Returns:
a list of entities


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly