Package com.querydsl.core
Class DefaultQueryMetadata
java.lang.Object
com.querydsl.core.DefaultQueryMetadata
- All Implemented Interfaces:
QueryMetadata,Serializable,Cloneable
- Direct Known Subclasses:
OrderedQueryMetadata
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.
- Author:
- tiwe
- See Also:
-
Constructor Summary
Constructors -
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 instancebooleangetFlags()Get all query flagsList<Expression<?>>Get the group by expressionsGet the having expressionsgetJoins()Get the query joinsGet the QueryModifiersList<OrderSpecifier<?>>Get the OrderSpecifiersMap<ParamExpression<?>,Object> Get the parameter bindingsExpression<?>Get the projectiongetWhere()Get the expressions aggregated into a single boolean expression or null, if none where definedbooleanReturn whether the given query flag is appliedinthashCode()booleanGet whether the projection is distinctbooleanisUnique()Get whether the projection is uniqueDisable validationvoidremoveFlag(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 flagvoidsetValidatingVisitor(ValidatingVisitor visitor)
-
Constructor Details
-
DefaultQueryMetadata
public DefaultQueryMetadata()Create an empty DefaultQueryMetadata instance
-
-
Method Details
-
noValidate
Disable validation- Returns:
- the current object
-
addFlag
Description copied from interface:QueryMetadataAdd the given query flag- Specified by:
addFlagin interfaceQueryMetadata- Parameters:
flag- query flag
-
addJoinFlag
Description copied from interface:QueryMetadataAdd the given join flag to the last given join- Specified by:
addJoinFlagin interfaceQueryMetadata- Parameters:
flag- join flag
-
addGroupBy
Description copied from interface:QueryMetadataAdd the given group by expressions- Specified by:
addGroupByin interfaceQueryMetadata- Parameters:
o- group by expressions
-
addHaving
Description copied from interface:QueryMetadataAdd the given having expressions- Specified by:
addHavingin interfaceQueryMetadata- Parameters:
e- having conditions
-
addJoin
Description copied from interface:QueryMetadataAdd the given query join- Specified by:
addJoinin interfaceQueryMetadata- Parameters:
joinType- type of joinexpr- join target
-
addJoinCondition
Description copied from interface:QueryMetadataAdd the given join condition to the last given join- Specified by:
addJoinConditionin interfaceQueryMetadata- Parameters:
o- join condition
-
addOrderBy
Description copied from interface:QueryMetadataAdd the given order specifiers- Specified by:
addOrderByin interfaceQueryMetadata- Parameters:
o- order
-
setProjection
Description copied from interface:QueryMetadataSet the projection- Specified by:
setProjectionin interfaceQueryMetadata- Parameters:
o- projection
-
addWhere
Description copied from interface:QueryMetadataAdd the given where expressions- Specified by:
addWherein interfaceQueryMetadata- Parameters:
e- where condition
-
clearOrderBy
public void clearOrderBy()Description copied from interface:QueryMetadataClear the order expressions- Specified by:
clearOrderByin interfaceQueryMetadata
-
clearWhere
public void clearWhere()Description copied from interface:QueryMetadataClear the where expressions- Specified by:
clearWherein interfaceQueryMetadata
-
clone
Description copied from interface:QueryMetadataClone this QueryMetadata instance- Specified by:
clonein interfaceQueryMetadata- Overrides:
clonein classObject- Returns:
- new QueryMetadata instance with cloned state
-
getGroupBy
Description copied from interface:QueryMetadataGet the group by expressions- Specified by:
getGroupByin interfaceQueryMetadata- Returns:
- group by
-
getHaving
Description copied from interface:QueryMetadataGet the having expressions- Specified by:
getHavingin interfaceQueryMetadata- Returns:
- having condition, or null if none set
-
getJoins
Description copied from interface:QueryMetadataGet the query joins- Specified by:
getJoinsin interfaceQueryMetadata- Returns:
- joins
-
getModifiers
Description copied from interface:QueryMetadataGet the QueryModifiers- Specified by:
getModifiersin interfaceQueryMetadata- Returns:
- modifiers
-
getParams
Description copied from interface:QueryMetadataGet the parameter bindings- Specified by:
getParamsin interfaceQueryMetadata- Returns:
- parameter bindings
-
getOrderBy
Description copied from interface:QueryMetadataGet the OrderSpecifiers- Specified by:
getOrderByin interfaceQueryMetadata- Returns:
- order by
-
getProjection
Description copied from interface:QueryMetadataGet the projection- Specified by:
getProjectionin interfaceQueryMetadata- Returns:
- projection
-
getWhere
Description copied from interface:QueryMetadataGet the expressions aggregated into a single boolean expression or null, if none where defined- Specified by:
getWherein interfaceQueryMetadata- Returns:
- where condition or null, if none set
-
isDistinct
public boolean isDistinct()Description copied from interface:QueryMetadataGet whether the projection is distinct- Specified by:
isDistinctin interfaceQueryMetadata- Returns:
- distinct
-
isUnique
public boolean isUnique()Description copied from interface:QueryMetadataGet whether the projection is unique- Specified by:
isUniquein interfaceQueryMetadata- Returns:
- unique
-
reset
public void reset()Description copied from interface:QueryMetadataReset the projection- Specified by:
resetin interfaceQueryMetadata
-
setDistinct
public void setDistinct(boolean distinct) Description copied from interface:QueryMetadataSet the distinct flag- Specified by:
setDistinctin interfaceQueryMetadata- Parameters:
distinct- distinct
-
setLimit
Description copied from interface:QueryMetadataSet the maximum number of rows- Specified by:
setLimitin interfaceQueryMetadata- Parameters:
limit- limit
-
setModifiers
Description copied from interface:QueryMetadataSet the query modifiers limit and offset- Specified by:
setModifiersin interfaceQueryMetadata- Parameters:
restriction- restriction
-
setOffset
Description copied from interface:QueryMetadataSet the number of skipped rows- Specified by:
setOffsetin interfaceQueryMetadata- Parameters:
offset- offset
-
setUnique
public void setUnique(boolean unique) Description copied from interface:QueryMetadataSet the unique flag- Specified by:
setUniquein interfaceQueryMetadata- Parameters:
unique- unique
-
setParam
Description copied from interface:QueryMetadataBind the value for the given parameter expression- Specified by:
setParamin interfaceQueryMetadata- Type Parameters:
T- binding type- Parameters:
param- parametervalue- binding
-
getFlags
Description copied from interface:QueryMetadataGet all query flags- Specified by:
getFlagsin interfaceQueryMetadata- Returns:
- all used query flags
-
hasFlag
Description copied from interface:QueryMetadataReturn whether the given query flag is applied- Specified by:
hasFlagin interfaceQueryMetadata- Parameters:
flag- query flag- Returns:
- true, if present, false, if not
-
removeFlag
Description copied from interface:QueryMetadataRemove the given query flag- Specified by:
removeFlagin interfaceQueryMetadata- Parameters:
flag- query flag
-
setValidate
public void setValidate(boolean v) Description copied from interface:QueryMetadataSet the validate flag- Specified by:
setValidatein interfaceQueryMetadata- Parameters:
v- validate
-
setValidatingVisitor
-
equals
-
hashCode
public int hashCode()
-