Package de.businesscode.bcdui.wrs.load
Class SqlFromSubSelect
java.lang.Object
de.businesscode.bcdui.wrs.load.SqlFromSubSelect
Takes a single wrq:Select (formally a "sub-select") and turns it into a SQLStatementWithParams
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected Map<String,
WrqBindingSet> protected final SqlFromSubSelect
protected WrqBindingSetFromDerivedTable
protected Set<StandardBindingSet>
protected int
protected int
protected final Element
protected SQLStatementWithParams
protected final WrqInfo
protected final WrqQueryBuilder
protected static String
-
Constructor Summary
ConstructorsConstructorDescriptionSqlFromSubSelect
(WrqQueryBuilder wrqQueryBuilder, SqlFromSubSelect parent, Element selectElem) We are initialized for a full-select (SELECTSs connected with SET operators). -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBindingSetForWrqAlias
(String wrqAlias, WrqBindingSet bindingSet) Set the BindingSet for a user provided table expression aliasprotected void
Handles a "select-statement", i.e. a complete selectprotected void
generateFromClause
(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates 'FROM' and the tables with their join expressionprotected void
generateGroupingClause
(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates Grouping clauseprotected void
generateHavingClause
(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates Having SQL clauseprotected void
generateOrderClause
(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates Order-By clauseprotected void
generateSelectClause
(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates 'SELECT' plus the select listprotected void
generateWhereClause
(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates 'WHERE ' plus the filtergetBindingSetForWrqAlias
(String wrqAlias) Get the BindingSet for a user provided table expression aliasProduce a new unique sql table alias for the current select scopeAccess to parent select, may be null This is the namespace for table aliasesA BindingSet representing us as if we where a bnd:BindingSetAccess to the current overall query
-
Field Details
-
selectElem
-
wrqQueryBuilder
-
parent
-
wrqInfo
-
rowStart
protected int rowStart -
rowEnd
protected int rowEnd -
resolvedBindingSets
-
representingBindingSet
-
bindingSetForWrqAlias
-
aliasCounter
protected int aliasCounter -
wrqTransformRowLimitXsltStatic
-
selectStatement
-
-
Constructor Details
-
SqlFromSubSelect
public SqlFromSubSelect(WrqQueryBuilder wrqQueryBuilder, SqlFromSubSelect parent, Element selectElem) throws Exception We are initialized for a full-select (SELECTSs connected with SET operators).- Parameters:
wrqQueryBuilder
-selectElem
-- Throws:
Exception
-
-
Method Details
-
createSelectStatement
Handles a "select-statement", i.e. a complete select- Throws:
Exception
- See Also:
-
generateSelectClause
protected void generateSelectClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws BindingNotFoundException Generates 'SELECT' plus the select list- Throws:
BindingNotFoundException
-
generateFromClause
protected void generateFromClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws BindingException Generates 'FROM' and the tables with their join expression- Throws:
BindingException
-
generateWhereClause
protected void generateWhereClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws Exception Generates 'WHERE ' plus the filter -
generateGroupingClause
protected void generateGroupingClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws Exception Generates Grouping clause- Throws:
Exception
-
generateHavingClause
protected void generateHavingClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws XPathExpressionException, BindingException Generates Having SQL clause- Parameters:
wrqInfo
-sqlStatement
-- Throws:
XPathExpressionException
BindingException
-
generateOrderClause
protected void generateOrderClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws BindingNotFoundException Generates Order-By clause- Throws:
BindingNotFoundException
-
getBoundVariables
-
getSelectedBindingItems
-
getRepresentingBindingSet
A BindingSet representing us as if we where a bnd:BindingSet- Returns:
- Throws:
Exception
-
getWrqInfo
-
getResolvedBindingSets
-
getSelectStatement
-
getBindingSetForWrqAlias
Get the BindingSet for a user provided table expression alias- Parameters:
wrqAlias
-- Returns:
- Throws:
BindingNotFoundException
-
addBindingSetForWrqAlias
Set the BindingSet for a user provided table expression alias- Parameters:
wrqAlias
-bindingSet
-
-
getWrqQueryBuilder
Access to the current overall query- Returns:
-
getParent
Access to parent select, may be null This is the namespace for table aliases- Returns:
-
getNextTableSqlAlias
Produce a new unique sql table alias for the current select scope- Returns:
-
getSelectElem
-