com.mysema.query
Class DefaultQueryMetadata

java.lang.Object
  extended by com.mysema.query.DefaultQueryMetadata
All Implemented Interfaces:
QueryMetadata, Serializable, Cloneable
Direct Known Subclasses:
OrderedQueryMetadata

public class DefaultQueryMetadata
extends Object
implements QueryMetadata, Cloneable

DefaultQueryMetadata is the default implementation of the QueryMetadata interface

Author:
tiwe
See Also:
Serialized Form

Constructor Summary
DefaultQueryMetadata()
           
 
Method Summary
 void addFlag(QueryFlag flag)
           
 void addGroupBy(Expression<?>... o)
          Add the given group by expressions
 void addHaving(Predicate... o)
          Add the given having expressions
 void addJoin(JoinExpression... j)
          Add the given query join
 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 addOrderBy(OrderSpecifier<?>... o)
          Add the given order specifiers
 void addProjection(Expression<?>... o)
          Add the given projections
 void addWhere(Predicate... o)
          Add the given where expressions
 void clearOrderBy()
          Clear the order expressions
 void clearProjection()
          Clear the projection
 void clearWhere()
          Clear the where expressions
 QueryMetadata clone()
          Clone this QueryMetadata instance
 boolean equals(Object o)
           
 Set<QueryFlag> getFlags()
           
 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 parameters
 List<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)
           
 int hashCode()
           
 boolean isDistinct()
          Get whether the projection is distinct
 boolean isUnique()
          Get whether the projection is unique
 DefaultQueryMetadata noValidate()
           
 void reset()
          Reset the projection
 void setDistinct(boolean distinct)
           
 void setLimit(Long limit)
           
 void setModifiers(QueryModifiers restriction)
           
 void setOffset(Long offset)
           
<T> void
setParam(ParamExpression<T> param, T value)
           
 void setUnique(boolean unique)
           
 void setValidate(boolean v)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultQueryMetadata

public DefaultQueryMetadata()
Method Detail

noValidate

public DefaultQueryMetadata noValidate()

addGroupBy

public void addGroupBy(Expression<?>... o)
Description copied from interface: QueryMetadata
Add the given group by expressions

Specified by:
addGroupBy in interface QueryMetadata

addHaving

public void addHaving(Predicate... o)
Description copied from interface: QueryMetadata
Add the given having expressions

Specified by:
addHaving in interface QueryMetadata

addJoin

public void addJoin(JoinType joinType,
                    Expression<?> expr)
Description copied from interface: QueryMetadata
Add the given query join

Specified by:
addJoin in interface QueryMetadata

addJoin

public void addJoin(JoinExpression... j)
Description copied from interface: QueryMetadata
Add the given query join

Specified by:
addJoin in interface QueryMetadata

addJoinCondition

public void addJoinCondition(Predicate o)
Description copied from interface: QueryMetadata
Add the given join condition to the last given join

Specified by:
addJoinCondition in interface QueryMetadata

addOrderBy

public void addOrderBy(OrderSpecifier<?>... o)
Description copied from interface: QueryMetadata
Add the given order specifiers

Specified by:
addOrderBy in interface QueryMetadata

addProjection

public void addProjection(Expression<?>... o)
Description copied from interface: QueryMetadata
Add the given projections

Specified by:
addProjection in interface QueryMetadata

addWhere

public void addWhere(Predicate... o)
Description copied from interface: QueryMetadata
Add the given where expressions

Specified by:
addWhere in interface QueryMetadata

clearOrderBy

public void clearOrderBy()
Description copied from interface: QueryMetadata
Clear the order expressions

Specified by:
clearOrderBy in interface QueryMetadata

clearProjection

public void clearProjection()
Description copied from interface: QueryMetadata
Clear the projection

Specified by:
clearProjection in interface QueryMetadata

clearWhere

public void clearWhere()
Description copied from interface: QueryMetadata
Clear the where expressions

Specified by:
clearWhere in interface QueryMetadata

clone

public QueryMetadata clone()
Description copied from interface: QueryMetadata
Clone this QueryMetadata instance

Specified by:
clone in interface QueryMetadata
Overrides:
clone in class Object
Returns:

getGroupBy

public List<Expression<?>> getGroupBy()
Description copied from interface: QueryMetadata
Get the group by expressions

Specified by:
getGroupBy in interface QueryMetadata
Returns:

getHaving

public Predicate getHaving()
Description copied from interface: QueryMetadata
Get the having expressions

Specified by:
getHaving in interface QueryMetadata
Returns:

getJoins

public List<JoinExpression> getJoins()
Description copied from interface: QueryMetadata
Get the query joins

Specified by:
getJoins in interface QueryMetadata
Returns:

getModifiers

@Nullable
public QueryModifiers getModifiers()
Description copied from interface: QueryMetadata
Get the QueryModifiers

Specified by:
getModifiers in interface QueryMetadata
Returns:

getParams

public Map<ParamExpression<?>,Object> getParams()
Description copied from interface: QueryMetadata
Get the parameters

Specified by:
getParams in interface QueryMetadata
Returns:

getOrderBy

public List<OrderSpecifier<?>> getOrderBy()
Description copied from interface: QueryMetadata
Get the OrderSpecifiers

Specified by:
getOrderBy in interface QueryMetadata
Returns:

getProjection

public List<Expression<?>> getProjection()
Description copied from interface: QueryMetadata
Get the projection

Specified by:
getProjection in interface QueryMetadata
Returns:

getWhere

public Predicate getWhere()
Description copied from interface: QueryMetadata
Get the expressions aggregated into a single boolean expression or null, if none where defined

Specified by:
getWhere in interface QueryMetadata
Returns:

isDistinct

public boolean isDistinct()
Description copied from interface: QueryMetadata
Get whether the projection is distinct

Specified by:
isDistinct in interface QueryMetadata
Returns:

isUnique

public boolean isUnique()
Description copied from interface: QueryMetadata
Get whether the projection is unique

Specified by:
isUnique in interface QueryMetadata
Returns:

reset

public void reset()
Description copied from interface: QueryMetadata
Reset the projection

Specified by:
reset in interface QueryMetadata

setDistinct

public void setDistinct(boolean distinct)
Specified by:
setDistinct in interface QueryMetadata

setLimit

public void setLimit(Long limit)
Specified by:
setLimit in interface QueryMetadata

setModifiers

public void setModifiers(@Nullable
                         QueryModifiers restriction)
Specified by:
setModifiers in interface QueryMetadata

setOffset

public void setOffset(Long offset)
Specified by:
setOffset in interface QueryMetadata

setUnique

public void setUnique(boolean unique)
Specified by:
setUnique in interface QueryMetadata

setParam

public <T> void setParam(ParamExpression<T> param,
                         T value)
Specified by:
setParam in interface QueryMetadata

addFlag

public void addFlag(QueryFlag flag)
Specified by:
addFlag in interface QueryMetadata

getFlags

public Set<QueryFlag> getFlags()
Specified by:
getFlags in interface QueryMetadata
Returns:

hasFlag

public boolean hasFlag(QueryFlag flag)
Specified by:
hasFlag in interface QueryMetadata
Returns:

setValidate

public void setValidate(boolean v)
Specified by:
setValidate in interface QueryMetadata

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2007-2012 Mysema Ltd. All Rights Reserved.