T - the entity bean type (normal entity bean type e.g. Customer)R - the specific root query bean type (e.g. QCustomer)public abstract class TQRootBean<T,R> extends Object
With code generation for each entity bean type a query bean is created that extends this.
Provides common features for all root query beans
These 'query beans' like QCustomer are generated using the avaje-ebeanorm-typequery-generator.
public class QCustomer extends TQRootBean<Customer,QCustomer> {
// properties
public PLong<QCustomer> id;
public PString<QCustomer> name;
...
Date fiveDaysAgo = ...
List<Customer> customers =
new QCustomer()
.name.ilike("rob")
.status.equalTo(Customer.Status.GOOD)
.registered.after(fiveDaysAgo)
.contacts.email.endsWith("@foo.com")
.orderBy()
.name.asc()
.registered.desc()
.findList();
where lower(t0.name) like ? and t0.status = ? and t0.registered > ? and u1.email like ?
order by t0.name, t0.registered desc;
--bind(rob,GOOD,Mon Jul 27 12:05:37 NZST 2015,%@foo.com)
| Constructor and Description |
|---|
TQRootBean(boolean aliasDummy)
Construct for using as an 'Alias' to use the properties as known string
values for select() and fetch().
|
TQRootBean(Class<T> beanType)
Construct using the type of bean to query on and the default server.
|
TQRootBean(Class<T> beanType,
com.avaje.ebean.EbeanServer server)
Construct using the type of bean to query on and a given server.
|
TQRootBean(com.avaje.ebean.Query<T> query)
Construct using a query.
|
| Modifier and Type | Method and Description |
|---|---|
R |
alias(String alias)
Set root table alias.
|
R |
and()
Begin a list of expressions added by 'AND'.
|
R |
apply(com.avaje.ebean.text.PathProperties pathProperties)
Apply the path properties replacing the select and fetch clauses.
|
R |
asDraft()
Execute the query against the draft set of tables.
|
R |
asOf(Timestamp asOf)
Perform an 'As of' query using history tables to return the object graph
as of a time in the past.
|
int |
delete()
Execute as a delete query deleting the 'root level' beans that match the predicates
in the query.
|
R |
endAnd()
Deprecated.
|
R |
endJunction()
End a list of expressions added by 'OR'.
|
R |
endOr()
Deprecated.
|
R |
fetch(String path)
Specify a path to load including all its properties.
|
R |
fetch(String path,
com.avaje.ebean.FetchConfig fetchConfig)
Additionally specify a FetchConfig to specify a "query join" and or define
the lazy loading query.
|
R |
fetch(String path,
String fetchProperties)
Specify a path to fetch with its specific properties to include
(aka partial object).
|
R |
fetch(String path,
String fetchProperties,
com.avaje.ebean.FetchConfig fetchConfig)
Additionally specify a FetchConfig to use a separate query or lazy loading
to load this path.
|
void |
findEach(com.avaje.ebean.QueryEachConsumer<T> consumer)
Execute the query processing the beans one at a time.
|
void |
findEachWhile(com.avaje.ebean.QueryEachWhileConsumer<T> consumer)
Execute the query using callbacks to a visitor to process the resulting
beans one at a time.
|
com.avaje.ebean.FutureIds<T> |
findFutureIds()
Execute find Id's query in a background thread.
|
com.avaje.ebean.FutureList<T> |
findFutureList()
Execute find list query in a background thread.
|
com.avaje.ebean.FutureRowCount<T> |
findFutureRowCount()
Execute find row count query in a background thread.
|
List<Object> |
findIds()
Execute the query returning the list of Id's.
|
com.avaje.ebean.QueryIterator<T> |
findIterate()
Execute the query iterating over the results.
|
List<T> |
findList()
Execute the query returning the list of objects.
|
Map<?,T> |
findMap()
Execute the query returning a map of the objects.
|
<K> Map<K,T> |
findMap(String keyProperty,
Class<K> keyType)
Return a typed map specifying the key property and type.
|
com.avaje.ebean.PagedList<T> |
findPagedList()
Return a PagedList for this query using firstRow and maxRows.
|
com.avaje.ebean.PagedList<T> |
findPagedList(int pageIndex,
int pageSize)
Return a PagedList for this query using pageIndex and pageSize.
|
int |
findRowCount()
Return the count of entities this query should return.
|
T |
findUnique()
Execute the query returning either a single bean or null (if no matching
bean is found).
|
List<com.avaje.ebean.Version<T>> |
findVersions()
Return versions of a @History entity bean.
|
Class<T> |
getBeanType()
Return the type of beans being queried.
|
com.avaje.ebean.ExpressionList<T> |
getExpressionList()
Return the expression list that has been built for this query.
|
String |
getGeneratedSql()
Return the sql that was generated for executing this query.
|
R |
includeSoftDeletes()
Execute the query including soft deleted rows.
|
R |
multiMatch(String query,
com.avaje.ebean.search.MultiMatch multiMatch)
Add a Text Multi-match expression (document store only).
|
R |
multiMatch(String query,
String... properties)
Add a Text Multi-match expression (document store only).
|
R |
must()
Begin a list of expressions added by MUST.
|
R |
mustNot()
Begin a list of expressions added by MUST NOT.
|
R |
not()
Begin a list of expressions added by NOT.
|
R |
or()
Begin a list of expressions added by 'OR'.
|
R |
order()
Marker that can be used to indicate that the order by clause is defined after this.
|
R |
order(String orderByClause)
Set the full raw order by clause replacing the existing order by clause if there is one.
|
R |
orderBy()
Marker that can be used to indicate that the order by clause is defined after this.
|
R |
orderBy(String orderByClause)
Set the full raw order by clause replacing the existing order by clause if there is one.
|
com.avaje.ebean.Query<T> |
query()
Return the underlying query.
|
R |
raw(String rawExpression)
Add raw expression with no parameters.
|
R |
raw(String rawExpression,
Object... bindValues)
Add raw expression with an array of parameters.
|
R |
raw(String rawExpression,
Object bindValue)
Add raw expression with a single parameter.
|
R |
select(String fetchProperties)
Explicitly set a comma delimited list of the properties to fetch on the
'main' root level entity bean (aka partial object).
|
R |
select(TQProperty<R>... properties)
Tune the query by specifying the properties to be loaded on the
'main' root level entity bean (aka partial object).
|
R |
setAutoTune(boolean autoTune)
Explicitly specify whether to use AutoTune for this query.
|
R |
setBufferFetchSizeHint(int fetchSize)
A hint which for JDBC translates to the Statement.fetchSize().
|
R |
setDisableLazyLoading(boolean disableLazyLoading)
Set true if you want to disable lazy loading.
|
R |
setDisableReadAuditing()
Disable read auditing for this query.
|
R |
setDistinct(boolean distinct)
Set whether this query uses DISTINCT.
|
R |
setFirstRow(int firstRow)
Set the first row to return for this query.
|
R |
setForUpdate(boolean forUpdate)
executed the select with "for update" which should lock the record
"on read"
|
R |
setId(Object id)
Set the Id value to query.
|
R |
setLazyLoadBatchSize(int lazyLoadBatchSize)
Set the default lazy loading batch size to use.
|
R |
setLoadBeanCache(boolean loadBeanCache)
When set to true all the beans from this query are loaded into the bean
cache.
|
R |
setMapKey(String mapKey)
Set the property to use as keys for a map.
|
R |
setMaxRows(int maxRows)
Set the maximum number of rows to return in the query.
|
R |
setPersistenceContextScope(com.avaje.ebean.PersistenceContextScope scope)
Specify the PersistenceContextScope to use for this query.
|
R |
setRawSql(com.avaje.ebean.RawSql rawSql)
Set RawSql to use for this query.
|
R |
setReadOnly(boolean readOnly)
When set to true when you want the returned beans to be read only.
|
R |
setTimeout(int secs)
Set a timeout on this query.
|
R |
setUseCache(boolean useCache)
Set this to true to use the bean cache.
|
R |
setUseDocStore(boolean useDocStore)
Set to true if this query should execute against the doc store.
|
R |
setUseQueryCache(boolean useCache)
Set this to true to use the query cache.
|
R |
should()
Begin a list of expressions added by SHOULD.
|
R |
text()
Begin added expressions to the 'Text' expression list.
|
R |
textCommonTerms(String query,
com.avaje.ebean.search.TextCommonTerms options)
Add a Text common terms expression (document store only).
|
R |
textQueryString(String query,
com.avaje.ebean.search.TextQueryString options)
Add a Text query string expression (document store only).
|
R |
textSimple(String query,
com.avaje.ebean.search.TextSimple options)
Add a Text simple expression (document store only).
|
Set<String> |
validate()
Returns the set of properties or paths that are unknown (do not map to known properties or paths).
|
R |
where()
Add expression after this to the WHERE expression list.
|
public TQRootBean(Class<T> beanType)
public TQRootBean(Class<T> beanType, com.avaje.ebean.EbeanServer server)
public TQRootBean(com.avaje.ebean.Query<T> query)
public TQRootBean(boolean aliasDummy)
public com.avaje.ebean.Query<T> query()
Generally it is not expected that you will need to do this but typically use the find methods available on this 'root query bean' instance like findList().
public R select(String fetchProperties)
You use fetch(String, String) to specify specific properties to fetch
on other non-root level paths of the object graph.
List<Customer> customers =
new QCustomer()
// Only fetch the customer id, name and status.
// This is described as a "Partial Object"
.select("name, status")
.name.ilike("rob%")
.findList();
fetchProperties - the properties to fetch for this bean (* = all properties).@SafeVarargs public final R select(TQProperty<R>... properties)
// alias for the customer properties in select()
QCustomer cust = QCustomer.alias();
// alias for the contact properties in contacts.fetch()
QContact contact = QContact.alias();
List<Customer> customers =
new QCustomer()
// tune query
.select(cust.id, cust.name)
.contacts.fetch(contact.firstName, contact.lastName, contact.email)
// predicates
.id.greaterThan(1)
.findList();
properties - the list of properties to fetchpublic R fetch(String path)
The same as fetch(String, String) with the fetchProperties as "*".
// fetch customers (their id, name and status)
List<Customer> customers =
ebeanServer.find(Customer.class)
// eager fetch the contacts
.fetch("contacts")
.findList();
path - the property of an associated (1-1,1-M,M-1,M-M) bean.public R fetch(String path, String fetchProperties)
When you specify a join this means that property (associated bean(s)) will be fetched and populated. If you specify "*" then all the properties of the associated bean will be fetched and populated. You can specify a comma delimited list of the properties of that associated bean which means that only those properties are fetched and populated resulting in a "Partial Object" - a bean that only has some of its properties populated.
// query orders...
List<Order> orders =
ebeanserver.find(Order.class)
// fetch the customer...
// ... getting the customers name and phone number
.fetch("customer", "name, phoneNumber")
// ... also fetch the customers billing address (* = all properties)
.fetch("customer.billingAddress", "*")
.findList();
If columns is null or "*" then all columns/properties for that path are fetched.
// fetch customers (their id, name and status)
List<Customer> customers =
new QCustomer()
.select("name, status")
.fetch("contacts", "firstName,lastName,email")
.findList();
path - the path of an associated (1-1,1-M,M-1,M-M) bean.fetchProperties - properties of the associated bean that you want to include in the
fetch (* means all properties, null also means all properties).public R fetch(String path, String fetchProperties, com.avaje.ebean.FetchConfig fetchConfig)
// fetch customers (their id, name and status)
List<Customer> customers =
new QCustomer()
.select("name, status")
.fetch("contacts", "firstName,lastName,email", new FetchConfig().lazy(10))
.findList();
public R fetch(String path, com.avaje.ebean.FetchConfig fetchConfig)
// fetch customers (their id, name and status)
List<Customer> customers =
new QCustomer()
// lazy fetch contacts with a batch size of 100
.fetch("contacts", new FetchConfig().lazy(100))
.findList();
public R apply(com.avaje.ebean.text.PathProperties pathProperties)
This is typically used when the PathProperties is applied to both the query and the JSON output.
public R asOf(Timestamp asOf)
To perform this query the DB must have underlying history tables.
asOf - the date time in the past at which you want to view the datapublic R includeSoftDeletes()
public R setMaxRows(int maxRows)
maxRows - the maximum number of rows to return in the query.public R setFirstRow(int firstRow)
firstRow - the first row to include in the query result.public R setAutoTune(boolean autoTune)
If you do not call this method on a query the "Implicit AutoTune mode" is used to determine if AutoTune should be used for a given query.
AutoTune can add additional fetch paths to the query and specify which properties are included for each path. If you have explicitly defined some fetch paths AutoTune will not remove them.
public R setBufferFetchSizeHint(int fetchSize)
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet.
public R setDistinct(boolean distinct)
public R setForUpdate(boolean forUpdate)
public R setId(Object id)
You can use this to have further control over the query. For example adding fetch joins.
Order order =
new QOrder()
.setId(1)
.fetch("details")
.findUnique();
// the order details were eagerly fetched
List<OrderDetail> details = order.getDetails();
public R setLazyLoadBatchSize(int lazyLoadBatchSize)
When lazy loading is invoked on beans loaded by this query then this sets the batch size used to load those beans.
lazyLoadBatchSize - the number of beans to lazy load in a single batchpublic R setLoadBeanCache(boolean loadBeanCache)
public R setMapKey(String mapKey)
If no property is set then the id property is used.
// Assuming sku is unique for products...
Map<?,Product> productMap =
new QProduct()
// use sku for keys...
.setMapKey("sku")
.findMap();
mapKey - the property to use as keys for a map.public R setPersistenceContextScope(com.avaje.ebean.PersistenceContextScope scope)
When this is not set the 'default' configured on com.avaje.ebean.config.ServerConfig#setPersistenceContextScope(PersistenceContextScope)
is used - this value defaults to PersistenceContextScope.TRANSACTION.
Note that the same persistence Context is used for subsequent lazy loading and query join queries.
Note that #findEach uses a 'per object graph' PersistenceContext so this scope is ignored for queries executed as #findIterate, #findEach, #findEachWhile.
scope - The scope to use for this query and subsequent lazy loading.public R setReadOnly(boolean readOnly)
public R setUseCache(boolean useCache)
If the query result is in cache then by default this same instance is returned. In this sense it should be treated as a read only object graph.
public R setUseDocStore(boolean useDocStore)
When setting this you may also consider disabling lazy loading.
public R setDisableLazyLoading(boolean disableLazyLoading)
That is, once the object graph is returned further lazy loading is disabled.
public R setDisableReadAuditing()
This is intended to be used when the query is not a user initiated query and instead part of the internal processing in an application to load a cache or document store etc. In these cases we don't want the query to be part of read auditing.
public R setUseQueryCache(boolean useCache)
public R setTimeout(int secs)
This will typically result in a call to setQueryTimeout() on a preparedStatement. If the timeout occurs an exception will be thrown - this will be a SQLException wrapped up in a PersistenceException.
secs - the query timeout limit in seconds. Zero means there is no limit.public Set<String> validate()
Validate the query checking the where and orderBy expression paths to confirm if they represent valid properties or paths for the given bean type.
public R raw(String rawExpression)
When properties in the clause are fully qualified as table-column names then they are not translated. logical property name names (not fully qualified) will still be translated to their physical name.
raw("orderQty < shipQty")
public R raw(String rawExpression, Object... bindValues)
The raw expression should contain the same number of ? as there are parameters.
When properties in the clause are fully qualified as table-column names then they are not translated. logical property name names (not fully qualified) will still be translated to their physical name.
public R raw(String rawExpression, Object bindValue)
The raw expression should contain a single ? at the location of the parameter.
When properties in the clause are fully qualified as table-column names then they are not translated. logical property name names (not fully qualified) will still be translated to their physical name.
// use a database function
raw("add_days(orderDate, 10) < ?", someDate)
public R orderBy()
order() and orderBy() are synonyms and both exist for historic reasons.
List<Order> orders =
new QOrder()
.customer.name.ilike("rob")
.orderBy()
.customer.name.asc()
.orderDate.asc()
.findList();
public R order()
order() and orderBy() are synonyms and both exist for historic reasons.
List<Order> orders =
new QOrder()
.customer.name.ilike("rob")
.order()
.customer.name.asc()
.orderDate.asc()
.findList();
public R orderBy(String orderByClause)
This follows SQL syntax using commas between each property with the optional asc and desc keywords representing ascending and descending order respectively.
This is EXACTLY the same as order(String).
public R order(String orderByClause)
This follows SQL syntax using commas between each property with the optional asc and desc keywords representing ascending and descending order respectively.
This is EXACTLY the same as orderBy(String).
public R or()
Use endJunction() to stop added to OR and 'pop' to the parent expression list.
This example uses an 'OR' expression list with an inner 'AND' expression list.
List<Customer> customers =
new QCustomer()
.status.equalTo(Customer.Status.GOOD)
.or()
.id.greaterThan(1000)
.and()
.name.startsWith("super")
.registered.after(fiveDaysAgo)
.endAnd()
.endOr()
.orderBy().id.desc()
.findList();
where t0.status = ? and (t0.id > ? or (t0.name like ? and t0.registered > ? ) )
order by t0.id desc;
--bind(GOOD,1000,super%,Wed Jul 22 00:00:00 NZST 2015)
public R and()
Use endJunction() to stop added to AND and 'pop' to the parent expression list.
Note that typically the AND expression is only used inside an outer 'OR' expression. This is because the top level expression list defaults to an 'AND' expression list.
This example uses an 'OR' expression list with an inner 'AND' expression list.
List<Customer> customers =
new QCustomer()
.status.equalTo(Customer.Status.GOOD)
.or() // OUTER 'OR'
.id.greaterThan(1000)
.and() // NESTED 'AND' expression list
.name.startsWith("super")
.registered.after(fiveDaysAgo)
.endJunction()
.endJunction()
.orderBy().id.desc()
.findList();
where t0.status = ? and (t0.id > ? or (t0.name like ? and t0.registered > ? ) )
order by t0.id desc;
--bind(GOOD,1000,super%,Wed Jul 22 00:00:00 NZST 2015)
public R not()
Use endJunction() to stop added to NOT and 'pop' to the parent expression list.
public R must()
This automatically makes this query a document store query.
Use endJunction() to stop added to MUST and 'pop' to the parent expression list.
public R mustNot()
This automatically makes this query a document store query.
Use endJunction() to stop added to MUST NOT and 'pop' to the parent expression list.
public R should()
This automatically makes this query a document store query.
Use endJunction() to stop added to SHOULD and 'pop' to the parent expression list.
public R endJunction()
public R where()
For queries against the normal database (not the doc store) this has no effect.
This is intended for use with Document Store / ElasticSearch where expressions can be put into either the "query" section or the "filter" section of the query. Full text expressions like MATCH are in the "query" section but many expression can be in either - expressions after the where() are put into the "filter" section which means that they don't add to the relevance and are also cache-able.
public R text()
This automatically makes the query a document store query.
For ElasticSearch expressions added to 'text' go into the ElasticSearch 'query context' and expressions added to 'where' go into the ElasticSearch 'filter context'.
public R multiMatch(String query, com.avaje.ebean.search.MultiMatch multiMatch)
This automatically makes the query a document store query.
public R multiMatch(String query, String... properties)
This automatically makes the query a document store query.
public R textCommonTerms(String query, com.avaje.ebean.search.TextCommonTerms options)
This automatically makes the query a document store query.
public R textSimple(String query, com.avaje.ebean.search.TextSimple options)
This automatically makes the query a document store query.
public R textQueryString(String query, com.avaje.ebean.search.TextQueryString options)
This automatically makes the query a document store query.
@Nullable public T findUnique()
If more than 1 row is found for this query then a PersistenceException is thrown.
This is useful when your predicates dictate that your query should only return 0 or 1 results.
// assuming the sku of products is unique...
Product product =
new QProduct()
.sku.equalTo("aa113")
.findUnique();
...
It is also useful with finding objects by their id when you want to specify further join information to optimise the query.
// Fetch order 42 and additionally fetch join its order details...
Order order =
new QOrder()
.fetch("details") // eagerly load the order details
.id.equalTo(42)
.findUnique();
// the order details were eagerly loaded
List<OrderDetail> details = order.getDetails();
...
public List<T> findList()
This query will execute against the EbeanServer that was used to create it.
List<Customer> customers =
new QCustomer()
.name.ilike("rob%")
.findList();
EbeanServer.findList(Query, Transaction)public List<Object> findIds()
This query will execute against the EbeanServer that was used to create it.
EbeanServer.findIds(Query, Transaction)public com.avaje.ebean.QueryIterator<T> findIterate()
Remember that with QueryIterator you must call
QueryIterator.close() when you have finished iterating the results
(typically in a finally block).
findEach() and findEachWhile() are preferred to findIterate() as they ensure the jdbc statement and resultSet are closed at the end of the iteration.
This query will execute against the EbeanServer that was used to create it.
public Map<?,T> findMap()
This query will execute against the EbeanServer that was used to create it.
You can use setMapKey() so specify the property values to be used as keys on the map. If one is not specified then the id property is used.
Map<?, Product> map =
ebeanServer.find(Product.class)
.setMapKey("sku")
.findMap();
EbeanServer.findMap(Query, Transaction)public <K> Map<K,T> findMap(String keyProperty, Class<K> keyType)
public void findEach(com.avaje.ebean.QueryEachConsumer<T> consumer)
This method is appropriate to process very large query results as the beans are consumed one at a time and do not need to be held in memory (unlike #findList #findSet etc)
Note that internally Ebean can inform the JDBC driver that it is expecting larger resultSet and specifically for MySQL this hint is required to stop it's JDBC driver from buffering the entire resultSet. As such, for smaller resultSets findList() is generally preferable.
Compared with #findEachWhile this will always process all the beans where as #findEachWhile provides a way to stop processing the query result early before all the beans have been read.
This method is functionally equivalent to findIterate() but instead of using an iterator uses the QueryEachConsumer (SAM) interface which is better suited to use with Java8 closures.
new QCustomer()
.status.equalTo(Status.NEW)
.orderBy().id.asc()
.findEach((Customer customer) -> {
// do something with customer
System.out.println("-- visit " + customer);
});
consumer - the consumer used to process the queried beans.public void findEachWhile(com.avaje.ebean.QueryEachWhileConsumer<T> consumer)
This method is functionally equivalent to findIterate() but instead of using an iterator uses the QueryEachWhileConsumer (SAM) interface which is better suited to use with Java8 closures.
new QCustomer()
.status.equalTo(Status.NEW)
.order().id.asc()
.findEachWhile((Customer customer) -> {
// do something with customer
System.out.println("-- visit " + customer);
// return true to continue processing or false to stop
return (customer.getId() < 40);
});
consumer - the consumer used to process the queried beans.public List<com.avaje.ebean.Version<T>> findVersions()
Generally this query is expected to be a find by id or unique predicates query. It will execute the query against the history returning the versions of the bean.
public int findRowCount()
This is the number of 'top level' or 'root level' entities.
public com.avaje.ebean.FutureRowCount<T> findFutureRowCount()
This returns a Future object which can be used to cancel, check the execution status (isDone etc) and get the value (with or without a timeout).
public com.avaje.ebean.FutureIds<T> findFutureIds()
This returns a Future object which can be used to cancel, check the execution status (isDone etc) and get the value (with or without a timeout).
public com.avaje.ebean.FutureList<T> findFutureList()
This query will execute in it's own PersistenceContext and using its own transaction. What that means is that it will not share any bean instances with other queries.
public com.avaje.ebean.PagedList<T> findPagedList(int pageIndex, int pageSize)
The benefit of using this over just using the normal Query.setFirstRow(int) and
Query.setMaxRows(int) is that it additionally wraps an optional call to
Query.findFutureRowCount() to determine total row count, total page count etc.
Internally this works using Query.setFirstRow(int) and Query.setMaxRows(int) on
the query. This translates into SQL that uses limit offset, rownum or row_number function to
limit the result set.
// We want to find the first 100 new orders
// ... 0 means first page
// ... page size is 100
PagedList<Order> pagedList
= new QOrder()
.status.equalTo(Order.Status.NEW)
.order().id.asc()
.findPagedList(0, 100);
// Optional: initiate the loading of the total
// row count in a background thread
pagedList.loadRowCount();
// fetch and return the list in the foreground thread
List<Order> orders = pagedList.getList();
// get the total row count (from the future)
int totalRowCount = pagedList.getTotalRowCount();
pageIndex - The zero based index of the page.pageSize - The number of beans to return per page.public com.avaje.ebean.PagedList<T> findPagedList()
The benefit of using this over findList() is that it provides functionality to get the total row count etc.
If maxRows is not set on the query prior to calling findPagedList() then a PersistenceException is thrown.
PagedList<Order> pagedList = Ebean.find(Order.class)
.setFirstRow(50)
.setMaxRows(20)
.findPagedList();
// fetch the total row count in the background
pagedList.loadRowCount();
List<Order> orders = pagedList.getList();
int totalRowCount = pagedList.getTotalRowCount();
public int delete()
Note that if the query includes joins then the generated delete statement may not be optimal depending on the database platform.
public String getGeneratedSql()
This is only available after the query has been executed and provided only for informational purposes.
public Class<T> getBeanType()
public com.avaje.ebean.ExpressionList<T> getExpressionList()
Copyright © 2016. All rights reserved.