public class DefaultQueryMetadata extends Object implements QueryMetadata, Cloneable
DefaultQueryMetadata
is the default implementation of the QueryMetadata
interface.
DefaultQueryMetadata
is mutable, but clone()
can be used to
created deep copies to refine the state without modifying the initial instance.
Constructor and Description |
---|
DefaultQueryMetadata()
Create an empty DefaultQueryMetadata instance
|
Modifier and Type | Method and Description |
---|---|
void |
addFlag(QueryFlag flag)
Add the given query flag
|
void |
addGroupBy(Expression<?> o)
Add the given group by expressions
|
void |
addHaving(Predicate e)
Add the given having expressions
|
void |
addJoin(JoinType joinType,
Expression<?> expr)
Add the given query join
|
void |
addJoinCondition(Predicate o)
Add the given join condition to the last given join
|
void |
addJoinFlag(JoinFlag flag)
Add the given join flag to the last given join
|
void |
addOrderBy(OrderSpecifier<?> o)
Add the given order specifiers
|
void |
addWhere(Predicate e)
Add the given where expressions
|
void |
clearOrderBy()
Clear the order expressions
|
void |
clearWhere()
Clear the where expressions
|
QueryMetadata |
clone()
Clone this QueryMetadata instance
|
boolean |
equals(Object o) |
Set<QueryFlag> |
getFlags()
Get all query flags
|
List<Expression<?>> |
getGroupBy()
Get the group by expressions
|
Predicate |
getHaving()
Get the having expressions
|
List<JoinExpression> |
getJoins()
Get the query joins
|
QueryModifiers |
getModifiers()
Get the QueryModifiers
|
List<OrderSpecifier<?>> |
getOrderBy()
Get the OrderSpecifiers
|
Map<ParamExpression<?>,Object> |
getParams()
Get the parameter bindings
|
Expression<?> |
getProjection()
Get the projection
|
Predicate |
getWhere()
Get the expressions aggregated into a single boolean expression or null,
if none where defined
|
boolean |
hasFlag(QueryFlag flag)
Return whether the given query flag is applied
|
int |
hashCode() |
boolean |
isDistinct()
Get whether the projection is distinct
|
boolean |
isUnique()
Get whether the projection is unique
|
DefaultQueryMetadata |
noValidate()
Disable validation
|
void |
removeFlag(QueryFlag flag)
Remove the given query flag
|
void |
reset()
Reset the projection
|
void |
setDistinct(boolean distinct)
Set the distinct flag
|
void |
setLimit(Long limit)
Set the maximum number of rows
|
void |
setModifiers(QueryModifiers restriction)
Set the query modifiers limit and offset
|
void |
setOffset(Long offset)
Set the number of skipped rows
|
<T> void |
setParam(ParamExpression<T> param,
T value)
Bind the value for the given parameter expression
|
void |
setProjection(Expression<?> o)
Set the projection
|
void |
setUnique(boolean unique)
Set the unique flag
|
void |
setValidate(boolean v)
Set the validate flag
|
void |
setValidatingVisitor(ValidatingVisitor visitor) |
public DefaultQueryMetadata()
public DefaultQueryMetadata noValidate()
public void addFlag(QueryFlag flag)
QueryMetadata
addFlag
in interface QueryMetadata
flag
- query flagpublic void addJoinFlag(JoinFlag flag)
QueryMetadata
addJoinFlag
in interface QueryMetadata
flag
- join flagpublic void addGroupBy(Expression<?> o)
QueryMetadata
addGroupBy
in interface QueryMetadata
o
- group by expressionspublic void addHaving(Predicate e)
QueryMetadata
addHaving
in interface QueryMetadata
e
- having conditionspublic void addJoin(JoinType joinType, Expression<?> expr)
QueryMetadata
addJoin
in interface QueryMetadata
joinType
- type of joinexpr
- join targetpublic void addJoinCondition(Predicate o)
QueryMetadata
addJoinCondition
in interface QueryMetadata
o
- join conditionpublic void addOrderBy(OrderSpecifier<?> o)
QueryMetadata
addOrderBy
in interface QueryMetadata
o
- orderpublic void setProjection(Expression<?> o)
QueryMetadata
setProjection
in interface QueryMetadata
o
- projectionpublic void addWhere(Predicate e)
QueryMetadata
addWhere
in interface QueryMetadata
e
- where conditionpublic void clearOrderBy()
QueryMetadata
clearOrderBy
in interface QueryMetadata
public void clearWhere()
QueryMetadata
clearWhere
in interface QueryMetadata
public QueryMetadata clone()
QueryMetadata
clone
in interface QueryMetadata
clone
in class Object
public List<Expression<?>> getGroupBy()
QueryMetadata
getGroupBy
in interface QueryMetadata
public Predicate getHaving()
QueryMetadata
getHaving
in interface QueryMetadata
public List<JoinExpression> getJoins()
QueryMetadata
getJoins
in interface QueryMetadata
public QueryModifiers getModifiers()
QueryMetadata
getModifiers
in interface QueryMetadata
public Map<ParamExpression<?>,Object> getParams()
QueryMetadata
getParams
in interface QueryMetadata
public List<OrderSpecifier<?>> getOrderBy()
QueryMetadata
getOrderBy
in interface QueryMetadata
public Expression<?> getProjection()
QueryMetadata
getProjection
in interface QueryMetadata
public Predicate getWhere()
QueryMetadata
getWhere
in interface QueryMetadata
public boolean isDistinct()
QueryMetadata
isDistinct
in interface QueryMetadata
public boolean isUnique()
QueryMetadata
isUnique
in interface QueryMetadata
public void reset()
QueryMetadata
reset
in interface QueryMetadata
public void setDistinct(boolean distinct)
QueryMetadata
setDistinct
in interface QueryMetadata
distinct
- distinctpublic void setLimit(Long limit)
QueryMetadata
setLimit
in interface QueryMetadata
limit
- limitpublic void setModifiers(QueryModifiers restriction)
QueryMetadata
setModifiers
in interface QueryMetadata
restriction
- restrictionpublic void setOffset(Long offset)
QueryMetadata
setOffset
in interface QueryMetadata
offset
- offsetpublic void setUnique(boolean unique)
QueryMetadata
setUnique
in interface QueryMetadata
unique
- uniquepublic <T> void setParam(ParamExpression<T> param, T value)
QueryMetadata
setParam
in interface QueryMetadata
T
- binding typeparam
- parametervalue
- bindingpublic Set<QueryFlag> getFlags()
QueryMetadata
getFlags
in interface QueryMetadata
public boolean hasFlag(QueryFlag flag)
QueryMetadata
hasFlag
in interface QueryMetadata
flag
- query flagpublic void removeFlag(QueryFlag flag)
QueryMetadata
removeFlag
in interface QueryMetadata
flag
- query flagpublic void setValidate(boolean v)
QueryMetadata
setValidate
in interface QueryMetadata
v
- validatepublic void setValidatingVisitor(ValidatingVisitor visitor)
Copyright © 2007–2016 Querydsl. All rights reserved.