Package rife.database.queries
Class Select
Object representation of a SQL "SELECT" query.
This object may be used to dynamically construct a SQL statement in a
database-independent fashion. After it is finished, it may be executed using
one of the query methods on DbQueryManager
.
- Since:
- 1.0
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
static class
class
class
class
class
class
static class
class
static class
class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Select.OrderByDirection
protected Datasource
static final Select.OrderByDirection
protected boolean
static final Select.JoinType
static final Select.JoinType
static final Select.JoinCondition
static final Select.JoinCondition
static final Select.JoinType
protected String
static final Select.JoinCondition
Fields inherited from class rife.database.queries.AbstractWhereQuery
where_
-
Constructor Summary
ConstructorDescriptionSelect
(Datasource datasource) Select
(Datasource datasource, Class constrainedClass) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_fieldSubselect
(Select query) protected void
_tableSubselect
(Select query) protected void
_unionSubselect
(Select query) protected void
_whereSubselect
(Select query) protected void
addFieldParameter
(String field) protected void
addWhereParameter
(String field) void
addWhereParameters
(List<String> parameters) void
addWhereParameters
(List<String> parameters) void
clear()
void
protected void
clone()
distinct()
distinctOn
(String column) distinctOn
(String... columns) fieldsExcluded
(Class beanClass, String... excludedFields) fieldsExcluded
(String table, Class beanClass, String... excludedFields) fieldSubselect
(Select query) rife.database.capabilities.Capabilities
getFrom()
getHint()
getJoins()
int
getLimit()
int
getSql()
protected Template
groupByExcluded
(Class beanClass, String... excludedFields) boolean
protected boolean
joinCustom
(String customJoin) joinInner
(String table, Select.JoinCondition condition, String conditionExpression) joinOuter
(String table, Select.JoinType type, Select.JoinCondition condition, String conditionExpression) limit
(int limit) limitParameter
(String name) offset
(int offset) offsetParameter
(String name) orderBy
(String column, Select.OrderByDirection direction) void
setExcludeUnsupportedCapabilities
(boolean flag) protected void
setLimitParameter
(String limitParameter) protected void
setOffsetParameter
(String offsetParameter) tableSubselect
(Select query) toString()
Methods inherited from class rife.database.queries.AbstractWhereQuery
getWhere, startWhere, startWhereAnd, startWhereOr, where, where, where, where, where, whereAnd, whereAnd, whereAnd, whereAnd, whereExcluded, whereFiltered, whereIncluded, whereOr, whereOr, whereOr, whereOr, whereParameter, whereParameter, whereParameterAnd, whereParameterAnd, whereParameterOr, whereParameterOr, whereParameters, whereParametersExcluded, whereSubselect
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface rife.database.queries.Query
getParameters, setExcludeUnsupportedCapabilities
-
Field Details
-
NATURAL
-
ON
-
USING
-
LEFT
-
RIGHT
-
FULL
-
ASC
-
DESC
-
datasource_
-
sql_
-
excludeUnsupportedCapabilities_
protected boolean excludeUnsupportedCapabilities_
-
-
Constructor Details
-
Select
-
Select
-
-
Method Details
-
clear
public void clear()- Specified by:
clear
in interfaceQuery
- Overrides:
clear
in classAbstractWhereQuery<Select>
-
clearGenerated
public void clearGenerated() -
getHint
-
getFields
-
isDistinct
public boolean isDistinct() -
getDistinctOn
-
getFrom
-
getJoins
-
getGroupBy
-
getHaving
-
getUnions
-
getOrderBy
-
getLimit
public int getLimit() -
getOffset
public int getOffset() -
getTemplate
-
getCapabilities
public rife.database.capabilities.Capabilities getCapabilities()- Specified by:
getCapabilities
in interfaceQuery
-
getSql
- Specified by:
getSql
in interfaceQuery
- Throws:
DbQueryException
-
hint
-
field
-
field
-
fields
- Throws:
DbQueryException
-
fieldsExcluded
- Throws:
DbQueryException
-
fields
- Throws:
DbQueryException
-
fieldsExcluded
public Select fieldsExcluded(String table, Class beanClass, String... excludedFields) throws DbQueryException - Throws:
DbQueryException
-
fields
-
distinct
-
distinctOn
-
distinctOn
-
from
-
from
-
from
-
join
-
join
-
joinCustom
-
joinCross
-
joinInner
-
joinOuter
public Select joinOuter(String table, Select.JoinType type, Select.JoinCondition condition, String conditionExpression) -
fieldSubselect
-
tableSubselect
-
groupBy
-
groupBy
- Throws:
DbQueryException
-
groupByExcluded
- Throws:
DbQueryException
-
having
-
union
-
union
- Throws:
DbQueryException
-
unionAll
-
unionAll
- Throws:
DbQueryException
-
orderBy
-
orderBy
-
limit
-
limitParameter
-
offset
-
isLimitBeforeOffset
protected boolean isLimitBeforeOffset() -
offsetParameter
-
clone
- Overrides:
clone
in classAbstractWhereQuery<Select>
-
addWhereParameters
-
_fieldSubselect
-
_tableSubselect
-
_whereSubselect
-
_unionSubselect
-
getParameters
- Specified by:
getParameters
in interfaceQuery
-
addFieldParameter
-
clearWhereParameters
protected void clearWhereParameters() -
addWhereParameter
-
getWhereParameters
-
addWhereParameters
-
setLimitParameter
-
getLimitParameter
-
setOffsetParameter
-
getOffsetParameter
-
getDatasource
-
setExcludeUnsupportedCapabilities
public void setExcludeUnsupportedCapabilities(boolean flag) - Specified by:
setExcludeUnsupportedCapabilities
in interfaceQuery
-
toString
-