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
Nested ClassesModifier and TypeClassDescriptionclassstatic classclassclassclassclassclassstatic classclassstatic classclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Select.OrderByDirectionprotected Datasourcestatic final Select.OrderByDirectionprotected booleanstatic final Select.JoinTypestatic final Select.JoinTypestatic final Select.JoinConditionstatic final Select.JoinConditionstatic final Select.JoinTypeprotected Stringstatic final Select.JoinConditionFields inherited from class rife.database.queries.AbstractWhereQuery
where_ -
Constructor Summary
ConstructorsConstructorDescriptionSelect(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 voidaddFieldParameter(String field) protected voidaddWhereParameter(String field) voidaddWhereParameters(List<String> parameters) voidaddWhereParameters(List<String> parameters) voidclear()voidprotected voidclone()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.CapabilitiesgetFrom()getHint()getJoins()intgetLimit()intgetSql()protected TemplategroupByExcluded(Class beanClass, String... excludedFields) booleanprotected booleanjoinCustom(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) voidsetExcludeUnsupportedCapabilities(boolean flag) protected voidsetLimitParameter(String limitParameter) protected voidsetOffsetParameter(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, whereSubselectMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
clearin interfaceQuery- Overrides:
clearin 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:
getCapabilitiesin interfaceQuery
-
getSql
- Specified by:
getSqlin 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:
clonein classAbstractWhereQuery<Select>
-
addWhereParameters
-
_fieldSubselect
-
_tableSubselect
-
_whereSubselect
-
_unionSubselect
-
getParameters
- Specified by:
getParametersin interfaceQuery
-
addFieldParameter
-
clearWhereParameters
protected void clearWhereParameters() -
addWhereParameter
-
getWhereParameters
-
addWhereParameters
-
setLimitParameter
-
getLimitParameter
-
setOffsetParameter
-
getOffsetParameter
-
getDatasource
-
setExcludeUnsupportedCapabilities
public void setExcludeUnsupportedCapabilities(boolean flag) - Specified by:
setExcludeUnsupportedCapabilitiesin interfaceQuery
-
toString
-