play.db.jpa
类 GenericModel.JPAQuery

java.lang.Object
  继承者 play.db.jpa.GenericModel.JPAQuery
直接已知子类:
JPASupport.JPAQuery
包容类:
GenericModel

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

A JPAQuery


字段摘要
 Query query
           
 java.lang.String sq
           
 
构造方法摘要
GenericModel.JPAQuery(Query query)
           
GenericModel.JPAQuery(java.lang.String sq, Query query)
           
 
方法摘要
 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.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

query

public Query query

sq

public java.lang.String sq
构造方法详细信息

GenericModel.JPAQuery

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

GenericModel.JPAQuery

public GenericModel.JPAQuery(Query query)
方法详细信息

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. Careful, this will also bind count results. This means that Integer get transformed into long so hibernate can do the right thing. Use the setParameter if you just want to set parameters.


setParameter

public GenericModel.JPAQuery setParameter(java.lang.String name,
                                          java.lang.Object param)
Set a named parameter for this query.


fetch

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

返回:
A list of entities

fetch

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

参数:
max - Max results to fetch
返回:
A list of entities

from

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

参数:
position - Position of the first element
返回:
A new query

fetch

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

参数:
page - Page number (start at 1)
length - (page length)
返回:
a list of entities


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