public final class SelectQueryImpl extends AbstractQueryObject implements SelectQuery
Constructor and Description |
---|
SelectQueryImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addProjection(Field field)
Adds the projection.
|
void |
addProjection(Field field,
String alias) |
void |
addSchema(Schema schema)
Adds the schema.
|
Literal |
newBoolean(boolean value)
New boolean.
|
Literal |
newEnum(Enum<?> identifier)
New enum.
|
Literal |
newNumeric(BigDecimal value)
New numeric.
|
Literal |
newNumeric(double value)
New numeric.
|
Literal |
newNumeric(long value)
New numeric.
|
Order |
newOrder(Field field)
New order.
|
Order |
newOrder(Field field,
OrderDirection direction)
New order.
|
Parameter |
newParameter(int position)
Factory method to create new Parameter.
|
Parameter |
newParameter(String name)
New parameter.
|
Schema |
newSchema(Class<?> type,
String identifier)
Factory method to create new Schema.
|
Schema |
newSchema(String name,
String identifier)
Factory method to create new Schema.
|
Literal |
newString(String value)
New string.
|
Expression |
newTemporal(TemporalType temporalType)
New temporal.
|
Expression |
newTemporal(TemporalType temporalType,
Calendar value)
New temporal.
|
Expression |
newTemporal(TemporalType temporalType,
Date value)
New temporal.
|
void |
setDistinct(boolean distinct)
Sets the distinct.
|
void |
setLimit(int limit)
Sets the limit.
|
void |
setLimit(int limit,
int offset)
Sets the limit.
|
void |
setLimit(Parameter limit)
Sets the limit.
|
void |
setLimit(Parameter limit,
Parameter offset)
Sets the limit.
|
void |
setOrder(Order order)
Sets the order.
|
void |
setWhere(Condition condition)
Sets the where.
|
StringBuilder |
toString(StringBuilder sb)
Append a string representation of the object to the given
StringBuilder . |
toString
public Schema newSchema(String name, String identifier)
newSchema
in interface SelectQuery
name
- the schemaidentifier
- the identifierpublic Schema newSchema(Class<?> type, String identifier)
newSchema
in interface SelectQuery
type
- the schemaidentifier
- the identifierpublic Parameter newParameter(int position)
newParameter
in interface SelectQuery
position
- the intpublic Parameter newParameter(String name)
newParameter
in interface SelectQuery
name
- the namepublic Literal newBoolean(boolean value)
newBoolean
in interface SelectQuery
value
- the valuepublic Literal newNumeric(long value)
newNumeric
in interface SelectQuery
value
- the valuepublic Literal newNumeric(double value)
newNumeric
in interface SelectQuery
value
- the valuepublic Literal newNumeric(BigDecimal value)
newNumeric
in interface SelectQuery
value
- the valuepublic Literal newString(String value)
newString
in interface SelectQuery
value
- the valuepublic Literal newEnum(Enum<?> identifier)
newEnum
in interface SelectQuery
identifier
- the identifierpublic Order newOrder(Field field)
newOrder
in interface SelectQuery
field
- the fieldpublic Order newOrder(Field field, OrderDirection direction)
newOrder
in interface SelectQuery
field
- the fielddirection
- the directionpublic Expression newTemporal(TemporalType temporalType)
newTemporal
in interface SelectQuery
temporalType
- the temporal typepublic Expression newTemporal(TemporalType temporalType, Date value)
newTemporal
in interface SelectQuery
temporalType
- the temporal typevalue
- the valuepublic Expression newTemporal(TemporalType temporalType, Calendar value)
newTemporal
in interface SelectQuery
temporalType
- the temporal typevalue
- the valuepublic void setDistinct(boolean distinct)
setDistinct
in interface SelectQuery
distinct
- the new distinctpublic void addProjection(Field field)
addProjection
in interface SelectQuery
field
- the fieldpublic void addSchema(Schema schema)
addSchema
in interface SelectQuery
schema
- the schemapublic void setWhere(Condition condition)
setWhere
in interface SelectQuery
condition
- the new wherepublic void setOrder(Order order)
setOrder
in interface SelectQuery
order
- the new orderpublic void setLimit(int limit)
setLimit
in interface SelectQuery
limit
- the new limitpublic void setLimit(Parameter limit)
setLimit
in interface SelectQuery
limit
- the new limitpublic void setLimit(int limit, int offset)
setLimit
in interface SelectQuery
limit
- the limitoffset
- the offsetpublic void setLimit(Parameter limit, Parameter offset)
setLimit
in interface SelectQuery
limit
- the limitoffset
- the offsetpublic StringBuilder toString(StringBuilder sb)
StringBuilder
.
In general, the toString method for query objects appends a string that textually
represents this object. The result should be a query string that complies to EJB QL
specification as long as the query object represents a syntay element of it. It is
required that all subclasses override this method.
The toString method defined at class Object is overwritten and calls this method.toString
in interface QueryObject
sb
- StringBuilder to append the string representation of this object to.Copyright © 2018. All rights reserved.