Package com.querydsl.core
Interface QueryMetadata
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultQueryMetadata,EmptyMetadata,OrderedQueryMetadata
QueryMetadata defines query metadata such as query sources, filtering
conditions and the projection- Author:
- tiwe
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the given query flagvoidaddGroupBy(Expression<?> o) Add the given group by expressionsvoidAdd the given having expressionsvoidaddJoin(JoinType joinType, Expression<?> expr) Add the given query joinvoidAdd the given join condition to the last given joinvoidaddJoinFlag(JoinFlag flag) Add the given join flag to the last given joinvoidaddOrderBy(OrderSpecifier<?> o) Add the given order specifiersvoidAdd the given where expressionsvoidClear the order expressionsvoidClear the where expressionsclone()Clone this QueryMetadata instancegetFlags()Get all query flags@Unmodifiable List<Expression<?>>Get the group by expressions@Nullable PredicateGet the having expressions@Unmodifiable List<JoinExpression>getJoins()Get the query joinsGet the QueryModifiers@Unmodifiable List<OrderSpecifier<?>>Get the OrderSpecifiers@Unmodifiable Map<ParamExpression<?>,Object> Get the parameter bindings@Nullable Expression<?>Get the projection@Nullable PredicategetWhere()Get the expressions aggregated into a single boolean expression or null, if none where definedbooleanReturn whether the given query flag is appliedbooleanGet whether the projection is distinctbooleanisUnique()Get whether the projection is uniquevoidremoveFlag(QueryFlag flag) Remove the given query flagvoidreset()Reset the projectionvoidsetDistinct(boolean distinct) Set the distinct flagvoidSet the maximum number of rowsvoidsetModifiers(QueryModifiers restriction) Set the query modifiers limit and offsetvoidSet the number of skipped rows<T> voidsetParam(ParamExpression<T> param, T value) Bind the value for the given parameter expressionvoidsetProjection(Expression<?> o) Set the projectionvoidsetUnique(boolean unique) Set the unique flagvoidsetValidate(boolean v) Set the validate flag
-
Method Details
-
addGroupBy
Add the given group by expressions- Parameters:
o- group by expressions
-
addHaving
Add the given having expressions- Parameters:
o- having conditions
-
addJoin
Add the given query join- Parameters:
joinType- type of joinexpr- join target
-
addJoinFlag
Add the given join flag to the last given join- Parameters:
flag- join flag
-
addJoinCondition
Add the given join condition to the last given join- Parameters:
o- join condition
-
addOrderBy
Add the given order specifiers- Parameters:
o- order
-
addWhere
Add the given where expressions- Parameters:
o- where condition
-
clearOrderBy
void clearOrderBy()Clear the order expressions -
clearWhere
void clearWhere()Clear the where expressions -
clone
QueryMetadata clone()Clone this QueryMetadata instance- Returns:
- new QueryMetadata instance with cloned state
-
getGroupBy
@Unmodifiable List<Expression<?>> getGroupBy()Get the group by expressions- Returns:
- group by
-
getHaving
Get the having expressions- Returns:
- having condition, or null if none set
-
getJoins
@Unmodifiable List<JoinExpression> getJoins()Get the query joins- Returns:
- joins
-
getModifiers
QueryModifiers getModifiers()Get the QueryModifiers- Returns:
- modifiers
-
getOrderBy
@Unmodifiable List<OrderSpecifier<?>> getOrderBy()Get the OrderSpecifiers- Returns:
- order by
-
getProjection
Get the projection- Returns:
- projection
-
getParams
@Unmodifiable Map<ParamExpression<?>,Object> getParams()Get the parameter bindings- Returns:
- parameter bindings
-
getWhere
Get the expressions aggregated into a single boolean expression or null, if none where defined- Returns:
- where condition or null, if none set
-
isDistinct
boolean isDistinct()Get whether the projection is distinct- Returns:
- distinct
-
isUnique
boolean isUnique()Get whether the projection is unique- Returns:
- unique
-
reset
void reset()Reset the projection -
setDistinct
void setDistinct(boolean distinct) Set the distinct flag- Parameters:
distinct- distinct
-
setLimit
Set the maximum number of rows- Parameters:
limit- limit
-
setModifiers
Set the query modifiers limit and offset- Parameters:
restriction- restriction
-
setOffset
Set the number of skipped rows- Parameters:
offset- offset
-
setUnique
void setUnique(boolean unique) Set the unique flag- Parameters:
unique- unique
-
setParam
Bind the value for the given parameter expression- Type Parameters:
T- binding type- Parameters:
param- parametervalue- binding
-
setProjection
Set the projection- Parameters:
o- projection
-
addFlag
Add the given query flag- Parameters:
flag- query flag
-
hasFlag
Return whether the given query flag is applied- Parameters:
flag- query flag- Returns:
- true, if present, false, if not
-
removeFlag
Remove the given query flag- Parameters:
flag- query flag
-
getFlags
Get all query flags- Returns:
- all used query flags
-
setValidate
void setValidate(boolean v) Set the validate flag- Parameters:
v- validate
-