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 intprotected Map<String,WrqBindingSet> protected final SqlFromSubSelectprotected WrqBindingSetFromDerivedTableprotected Set<StandardBindingSet>protected intprotected intprotected final Elementprotected SQLStatementWithParamsprotected final WrqInfoprotected final WrqQueryBuilderprotected 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 TypeMethodDescriptionvoidaddBindingSetForWrqAlias(String wrqAlias, WrqBindingSet bindingSet) Set the BindingSet for a user provided table expression aliasprotected voidHandles a "select-statement", i.e. a complete selectprotected voidgenerateFromClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates 'FROM' and the tables with their join expressionprotected voidgenerateGroupingClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates Grouping clauseprotected voidgenerateHavingClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates Having SQL clauseprotected voidgenerateOrderClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates Order-By clauseprotected voidgenerateSelectClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) Generates 'SELECT' plus the select listprotected voidgenerateWhereClause(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:
XPathExpressionExceptionBindingException
-
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
-