Class FilterExpressionList<T>
- java.lang.Object
-
- io.ebeaninternal.server.expression.DefaultExpressionList<T>
-
- io.ebeaninternal.server.expression.FilterExpressionList<T>
-
- All Implemented Interfaces:
Expression
,ExpressionList<T>
,SpiExpression
,SpiExpressionList<T>
public class FilterExpressionList<T> extends DefaultExpressionList<T>
-
-
Field Summary
-
Fields inherited from interface io.ebeaninternal.api.SpiExpression
SQL_FALSE, SQL_TRUE
-
-
Constructor Summary
Constructors Constructor Description FilterExpressionList(FilterExprPath pathPrefix, ExpressionFactory expr, Query<T> rootQuery)
FilterExpressionList(FilterExprPath pathPrefix, FilterExpressionList<T> original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyRowLimits(SpiQuery<?> query)
Apply firstRow maxRows limits on the filterMany query.boolean
exists()
Execute the query returning true if a row is found.ExpressionList<T>
filterMany(String prop)
Add some filter predicate expressions to the many property.int
findCount()
Return the count of entities this query should return.FutureRowCount<T>
findFutureCount()
Execute find row count query in a background thread.FutureIds<T>
findFutureIds()
Execute find Id's query in a background thread.FutureList<T>
findFutureList()
Execute find list query in a background thread.List<T>
findList()
Execute the query returning a list.<K> Map<K,T>
findMap()
Execute the query returning a map.T
findOne()
Execute the query returning a single bean or null (if no matching bean is found).Optional<T>
findOneOrEmpty()
Execute the query returning an optional bean.Set<T>
findSet()
Execute the query returning a set.ExpressionList<T>
having()
Add expressions to the having clause.ExpressionList<T>
idEq(Object value)
Id Equal to - ID property is equal to the value.ExpressionList<T>
idIn(Collection<?> idValues)
Id IN a collection of id values.OrderBy<T>
order()
Return the OrderBy so that you can append an ascending or descending property to the order by clause.ExpressionList<T>
order(String orderByClause)
Set the order by clause replacing the existing order by clause if there is one.ExpressionList<T>
orderBy(String orderByClause)
Set the order by clause replacing the existing order by clause if there is one.Query<T>
query()
Return the query that owns this expression list.Query<T>
select(String properties)
Specify specific properties to fetch on the main/root bean (aka partial object).ExpressionList<T>
setFirstRow(int firstRow)
Set the first row to fetch.Query<T>
setMapKey(String mapKey)
Set the name of the property which values become the key of a map.ExpressionList<T>
setMaxRows(int maxRows)
Set the maximum number of rows to fetch.Query<T>
setUseCache(boolean useCache)
Set to true when this query should use the bean cache.SpiExpressionList<?>
trimPath(int prefixTrim)
Return a copy of the ExpressionList with the path trimmed for filterMany() expressions.ExpressionList<T>
where()
Add another expression to the where clause.-
Methods inherited from class io.ebeaninternal.server.expression.DefaultExpressionList
add, addAll, addBindValues, addSql, allEq, and, and, apply, arrayContains, arrayIsEmpty, arrayIsNotEmpty, arrayNotContains, asDraft, asDto, asOf, asUpdate, between, betweenProperties, bitwiseAll, bitwiseAnd, bitwiseAny, bitwiseNot, conjunction, contains, containsMany, copy, copyForPlanKey, delete, delete, disjunction, endAnd, endJunction, endNot, endOr, endsWith, eq, eqOrNull, exampleLike, exists, filterMany, findEach, findEachWhile, findIds, findIterate, findPagedList, findSingleAttributeList, findVersions, findVersionsBetween, forUpdate, forUpdateNoWait, forUpdateSkipLocked, ge, getIdEqualTo, getUnderlyingList, gt, gtOrNull, icontains, idEqualTo, idIn, iendsWith, ieq, iexampleLike, ilike, in, in, in, ine, inOrEmpty, inPairs, inRange, inRangeWith, internalList, isEmpty, isEmpty, isNotEmpty, isNotNull, isNull, isSameByBind, istartsWith, jsonBetween, jsonEqualTo, jsonExists, jsonGreaterOrEqual, jsonGreaterThan, jsonLessOrEqualTo, jsonLessThan, jsonNotEqualTo, jsonNotExists, le, like, lt, ltOrNull, match, match, multiMatch, multiMatch, must, mustNot, naturalKey, ne, nestedPath, not, not, notExists, notIn, notIn, notIn, or, or, orderBy, orderById, prepareDocNested, prepareExpression, queryBindHash, queryPlanHash, raw, raw, raw, rawOrEmpty, select, setAllDocNested, setBeanCacheMode, setCountDistinct, setDisableLazyLoading, setDisableReadAuditing, setDistinct, setDocIndexName, setIncludeSoftDeletes, setLabel, setOrderBy, setUnderlying, setUseDocStore, setUseQueryCache, should, simplify, startsWith, textCommonTerms, textQueryString, textSimple, toJunction, update, update, usingConnection, usingTransaction, validate, where, writeDocQuery, writeDocQuery
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ebean.ExpressionList
findSingleAttribute, isIn, isIn, isIn, setUseQueryCache
-
-
-
-
Constructor Detail
-
FilterExpressionList
public FilterExpressionList(FilterExprPath pathPrefix, FilterExpressionList<T> original)
-
FilterExpressionList
public FilterExpressionList(FilterExprPath pathPrefix, ExpressionFactory expr, Query<T> rootQuery)
-
-
Method Detail
-
trimPath
public SpiExpressionList<?> trimPath(int prefixTrim)
Description copied from interface:SpiExpressionList
Return a copy of the ExpressionList with the path trimmed for filterMany() expressions.- Specified by:
trimPath
in interfaceSpiExpressionList<T>
- Overrides:
trimPath
in classDefaultExpressionList<T>
-
filterMany
public ExpressionList<T> filterMany(String prop)
Description copied from interface:ExpressionList
Add some filter predicate expressions to the many property.- Specified by:
filterMany
in interfaceExpressionList<T>
- Overrides:
filterMany
in classDefaultExpressionList<T>
-
findFutureIds
public FutureIds<T> findFutureIds()
Description copied from interface:ExpressionList
Execute find Id's query in a background thread.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).
- Specified by:
findFutureIds
in interfaceExpressionList<T>
- Overrides:
findFutureIds
in classDefaultExpressionList<T>
- Returns:
- a Future object for the list of Id's
-
findFutureList
public FutureList<T> findFutureList()
Description copied from interface:ExpressionList
Execute find list query in a background thread.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).
- Specified by:
findFutureList
in interfaceExpressionList<T>
- Overrides:
findFutureList
in classDefaultExpressionList<T>
- Returns:
- a Future object for the list result of the query
-
findFutureCount
public FutureRowCount<T> findFutureCount()
Description copied from interface:ExpressionList
Execute find row count query in a background thread.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).
- Specified by:
findFutureCount
in interfaceExpressionList<T>
- Overrides:
findFutureCount
in classDefaultExpressionList<T>
- Returns:
- a Future object for the row count query
-
findList
public List<T> findList()
Description copied from interface:ExpressionList
Execute the query returning a list.- Specified by:
findList
in interfaceExpressionList<T>
- Overrides:
findList
in classDefaultExpressionList<T>
- See Also:
Query.findList()
-
findMap
public <K> Map<K,T> findMap()
Description copied from interface:ExpressionList
Execute the query returning a map.- Specified by:
findMap
in interfaceExpressionList<T>
- Overrides:
findMap
in classDefaultExpressionList<T>
- See Also:
Query.findMap()
-
findCount
public int findCount()
Description copied from interface:ExpressionList
Return the count of entities this query should return.This is the number of 'top level' or 'root level' entities.
- Specified by:
findCount
in interfaceExpressionList<T>
- Overrides:
findCount
in classDefaultExpressionList<T>
-
findSet
public Set<T> findSet()
Description copied from interface:ExpressionList
Execute the query returning a set.- Specified by:
findSet
in interfaceExpressionList<T>
- Overrides:
findSet
in classDefaultExpressionList<T>
- See Also:
Query.findSet()
-
findOne
public T findOne()
Description copied from interface:ExpressionList
Execute the query returning a single bean or null (if no matching bean is found).If more than 1 row is found for this query then a NonUniqueResultException is thrown.
- Specified by:
findOne
in interfaceExpressionList<T>
- Overrides:
findOne
in classDefaultExpressionList<T>
- See Also:
Query.findOne()
-
findOneOrEmpty
public Optional<T> findOneOrEmpty()
Description copied from interface:ExpressionList
Execute the query returning an optional bean.- Specified by:
findOneOrEmpty
in interfaceExpressionList<T>
- Overrides:
findOneOrEmpty
in classDefaultExpressionList<T>
-
exists
public boolean exists()
Description copied from interface:ExpressionList
Execute the query returning true if a row is found.The query is executed using max rows of 1 and will only select the id property. This method is really just a convenient way to optimise a query to perform a 'does a row exist in the db' check.
Example:
boolean userExists = query().where().eq("email", "[email protected]").exists();
Example using a query bean:
boolean userExists = new QContact().email.equalTo("[email protected]").exists();
- Specified by:
exists
in interfaceExpressionList<T>
- Overrides:
exists
in classDefaultExpressionList<T>
- Returns:
- True if the query finds a matching row in the database
-
having
public ExpressionList<T> having()
Description copied from interface:ExpressionList
Add expressions to the having clause.The having clause is only used for queries based on raw sql (via SqlSelect annotation etc).
- Specified by:
having
in interfaceExpressionList<T>
- Overrides:
having
in classDefaultExpressionList<T>
-
idEq
public ExpressionList<T> idEq(Object value)
Description copied from interface:ExpressionList
Id Equal to - ID property is equal to the value.- Specified by:
idEq
in interfaceExpressionList<T>
- Overrides:
idEq
in classDefaultExpressionList<T>
-
idIn
public ExpressionList<T> idIn(Collection<?> idValues)
Description copied from interface:ExpressionList
Id IN a collection of id values.- Specified by:
idIn
in interfaceExpressionList<T>
- Overrides:
idIn
in classDefaultExpressionList<T>
-
query
public Query<T> query()
Description copied from interface:ExpressionList
Return the query that owns this expression list.This is a convenience method solely to support a fluid API where the methods are chained together. Adding expressions returns this expression list and this method can be used after that to return back the original query so that further things can be added to it.
- Specified by:
query
in interfaceExpressionList<T>
- Overrides:
query
in classDefaultExpressionList<T>
-
select
public Query<T> select(String properties)
Description copied from interface:ExpressionList
Specify specific properties to fetch on the main/root bean (aka partial object).- Specified by:
select
in interfaceExpressionList<T>
- Overrides:
select
in classDefaultExpressionList<T>
- See Also:
Query.select(String)
-
setMapKey
public Query<T> setMapKey(String mapKey)
Description copied from interface:ExpressionList
Set the name of the property which values become the key of a map.- Specified by:
setMapKey
in interfaceExpressionList<T>
- Overrides:
setMapKey
in classDefaultExpressionList<T>
- See Also:
Query.setMapKey(String)
-
order
public OrderBy<T> order()
Description copied from interface:ExpressionList
Return the OrderBy so that you can append an ascending or descending property to the order by clause.This will never return a null. If no order by clause exists then an 'empty' OrderBy object is returned.
This is the same as
orderBy()
- Specified by:
order
in interfaceExpressionList<T>
- Overrides:
order
in classDefaultExpressionList<T>
-
orderBy
public ExpressionList<T> orderBy(String orderByClause)
Description copied from interface:ExpressionList
Set the order by clause replacing the existing order by clause if there is one.This follows SQL syntax using commas between each property with the optional asc and desc keywords representing ascending and descending order respectively.
- Specified by:
orderBy
in interfaceExpressionList<T>
- Overrides:
orderBy
in classDefaultExpressionList<T>
-
order
public ExpressionList<T> order(String orderByClause)
Description copied from interface:ExpressionList
Set the order by clause replacing the existing order by clause if there is one.This follows SQL syntax using commas between each property with the optional asc and desc keywords representing ascending and descending order respectively.
- Specified by:
order
in interfaceExpressionList<T>
- Overrides:
order
in classDefaultExpressionList<T>
-
setMaxRows
public ExpressionList<T> setMaxRows(int maxRows)
Description copied from interface:ExpressionList
Set the maximum number of rows to fetch.- Specified by:
setMaxRows
in interfaceExpressionList<T>
- Overrides:
setMaxRows
in classDefaultExpressionList<T>
- See Also:
Query.setMaxRows(int)
-
setFirstRow
public ExpressionList<T> setFirstRow(int firstRow)
Description copied from interface:ExpressionList
Set the first row to fetch.- Specified by:
setFirstRow
in interfaceExpressionList<T>
- Overrides:
setFirstRow
in classDefaultExpressionList<T>
- See Also:
Query.setFirstRow(int)
-
setUseCache
public Query<T> setUseCache(boolean useCache)
Description copied from interface:ExpressionList
Set to true when this query should use the bean cache.This is now the same as setUseBeanCache(CacheMode.ON) and will be deprecated.
- Specified by:
setUseCache
in interfaceExpressionList<T>
- Overrides:
setUseCache
in classDefaultExpressionList<T>
- See Also:
Query.setUseCache(boolean)
-
where
public ExpressionList<T> where()
Description copied from interface:ExpressionList
Add another expression to the where clause.- Specified by:
where
in interfaceExpressionList<T>
- Overrides:
where
in classDefaultExpressionList<T>
-
applyRowLimits
public void applyRowLimits(SpiQuery<?> query)
Description copied from interface:SpiExpressionList
Apply firstRow maxRows limits on the filterMany query.
-
-