play.db.jpa
Class JPASupport.JPAQuery

java.lang.Object
  extended by play.db.jpa.JPASupport.JPAQuery
Enclosing class:
JPASupport

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

A JPAQuery


Field Summary
 javax.persistence.Query query
           
 java.lang.String sq
           
 
Constructor Summary
JPASupport.JPAQuery(javax.persistence.Query query)
           
JPASupport.JPAQuery(java.lang.String sq, javax.persistence.Query query)
           
 
Method Summary
<T> java.util.List<T>
all()
          Deprecated. 
 JPASupport.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> JPASupport.JPAQuery
from(int position)
          Set the position to start
<T> T
one()
          Deprecated. 
<T> java.util.List<T>
page(int page, int length)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

query

public javax.persistence.Query query

sq

public java.lang.String sq
Constructor Detail

JPASupport.JPAQuery

public JPASupport.JPAQuery(java.lang.String sq,
                           javax.persistence.Query query)

JPASupport.JPAQuery

public JPASupport.JPAQuery(javax.persistence.Query query)
Method Detail

one

@Deprecated
public <T> T one()
Deprecated. 

Try first();


first

public <T> T first()

bind

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


all

@Deprecated
public <T> java.util.List<T> all()
Deprecated. 

Try fetch();


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> JPASupport.JPAQuery from(int position)
Set the position to start

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

page

@Deprecated
public <T> java.util.List<T> page(int page,
                                             int length)
Deprecated. 

Try fetch(page, length);


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