Package org.castor.cpa.query.object
Class SelectQueryImpl
java.lang.Object
org.castor.cpa.query.object.AbstractQueryObject
org.castor.cpa.query.object.SelectQueryImpl
- All Implemented Interfaces:
QueryObject
,SelectQuery
Final class that implements SelectQuery.
- Since:
- 1.3
- Version:
- $Revision: 7121 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Udai Gupta, Ralf Joachim
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProjection
(Field field) Adds the projection.void
addProjection
(Field field, String alias) void
Adds the schema.newBoolean
(boolean value) New boolean.New enum.newNumeric
(double value) New numeric.newNumeric
(long value) New numeric.newNumeric
(BigDecimal value) New numeric.New order.newOrder
(Field field, OrderDirection direction) New order.newParameter
(int position) Factory method to create new Parameter.newParameter
(String name) New parameter.Factory method to create new Schema.Factory method to create new Schema.New string.newTemporal
(TemporalType temporalType) New temporal.newTemporal
(TemporalType temporalType, Calendar value) New temporal.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
Sets the limit.void
Sets the limit.void
Sets the order.void
Sets the where.Append a string representation of the object to the givenStringBuilder
.Methods inherited from class org.castor.cpa.query.object.AbstractQueryObject
toString
-
Constructor Details
-
SelectQueryImpl
public SelectQueryImpl()
-
-
Method Details
-
newSchema
Factory method to create new Schema.- Specified by:
newSchema
in interfaceSelectQuery
- Parameters:
name
- the schemaidentifier
- the identifier- Returns:
- the schema
-
newSchema
Factory method to create new Schema.- Specified by:
newSchema
in interfaceSelectQuery
- Parameters:
type
- the schemaidentifier
- the identifier- Returns:
- the schema
-
newParameter
Factory method to create new Parameter.- Specified by:
newParameter
in interfaceSelectQuery
- Parameters:
position
- the int- Returns:
- the parameter
-
newParameter
New parameter.- Specified by:
newParameter
in interfaceSelectQuery
- Parameters:
name
- the name- Returns:
- the parameter
-
newBoolean
New boolean.- Specified by:
newBoolean
in interfaceSelectQuery
- Parameters:
value
- the value- Returns:
- the literal
-
newNumeric
New numeric.- Specified by:
newNumeric
in interfaceSelectQuery
- Parameters:
value
- the value- Returns:
- the literal
-
newNumeric
New numeric.- Specified by:
newNumeric
in interfaceSelectQuery
- Parameters:
value
- the value- Returns:
- the literal
-
newNumeric
New numeric.- Specified by:
newNumeric
in interfaceSelectQuery
- Parameters:
value
- the value- Returns:
- the literal
-
newString
New string.- Specified by:
newString
in interfaceSelectQuery
- Parameters:
value
- the value- Returns:
- the literal
-
newEnum
New enum.- Specified by:
newEnum
in interfaceSelectQuery
- Parameters:
identifier
- the identifier- Returns:
- the literal
-
newOrder
New order.- Specified by:
newOrder
in interfaceSelectQuery
- Parameters:
field
- the field- Returns:
- the order
-
newOrder
New order.- Specified by:
newOrder
in interfaceSelectQuery
- Parameters:
field
- the fielddirection
- the direction- Returns:
- the order
-
newTemporal
New temporal.- Specified by:
newTemporal
in interfaceSelectQuery
- Parameters:
temporalType
- the temporal type- Returns:
- the expression
-
newTemporal
New temporal.- Specified by:
newTemporal
in interfaceSelectQuery
- Parameters:
temporalType
- the temporal typevalue
- the value- Returns:
- the expression
-
newTemporal
New temporal.- Specified by:
newTemporal
in interfaceSelectQuery
- Parameters:
temporalType
- the temporal typevalue
- the value- Returns:
- the expression
-
setDistinct
public void setDistinct(boolean distinct) Sets the distinct.- Specified by:
setDistinct
in interfaceSelectQuery
- Parameters:
distinct
- the new distinct
-
addProjection
Adds the projection.- Specified by:
addProjection
in interfaceSelectQuery
- Parameters:
field
- the field
-
addProjection
-
addSchema
Adds the schema.- Specified by:
addSchema
in interfaceSelectQuery
- Parameters:
schema
- the schema
-
setWhere
Sets the where.- Specified by:
setWhere
in interfaceSelectQuery
- Parameters:
condition
- the new where
-
setOrder
Sets the order.- Specified by:
setOrder
in interfaceSelectQuery
- Parameters:
order
- the new order
-
setLimit
public void setLimit(int limit) Sets the limit.- Specified by:
setLimit
in interfaceSelectQuery
- Parameters:
limit
- the new limit
-
setLimit
Sets the limit.- Specified by:
setLimit
in interfaceSelectQuery
- Parameters:
limit
- the new limit
-
setLimit
public void setLimit(int limit, int offset) Sets the limit.- Specified by:
setLimit
in interfaceSelectQuery
- Parameters:
limit
- the limitoffset
- the offset
-
setLimit
Sets the limit.- Specified by:
setLimit
in interfaceSelectQuery
- Parameters:
limit
- the limitoffset
- the offset
-
toString
Append a string representation of the object to the givenStringBuilder
. 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.- Specified by:
toString
in interfaceQueryObject
- Parameters:
sb
- StringBuilder to append the string representation of this object to.- Returns:
- Same instance of StringBuilder given as parameter.
-