Package de.businesscode.bcdui.wrs.load
Class SqlFromSubSelect
- java.lang.Object
-
- de.businesscode.bcdui.wrs.load.SqlFromSubSelect
-
public class SqlFromSubSelect extends java.lang.Object
Takes a single wrq:Select (formally a "sub-select") and turns it into a SQLStatementWithParams
-
-
Field Summary
Fields Modifier and Type Field Description protected int
aliasCounter
protected java.util.Map<java.lang.String,WrqBindingSet>
bindingSetForWrqAlias
protected SqlFromSubSelect
parent
protected WrqBindingSetFromDerivedTable
representingBindingSet
protected java.util.Set<StandardBindingSet>
resolvedBindingSets
protected int
rowEnd
protected int
rowStart
protected org.w3c.dom.Element
selectElem
protected SQLStatementWithParams
selectStatement
protected WrqInfo
wrqInfo
protected WrqQueryBuilder
wrqQueryBuilder
protected static java.lang.String
wrqTransformRowLimitXsltStatic
-
Constructor Summary
Constructors Constructor Description SqlFromSubSelect(WrqQueryBuilder wrqQueryBuilder, SqlFromSubSelect parent, org.w3c.dom.Element selectElem)
We are initialized for a full-select (SELECTSs connected with SET operators).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBindingSetForWrqAlias(java.lang.String wrqAlias, WrqBindingSet bindingSet)
Set the BindingSet for a user provided table expression aliasprotected void
createSelectStatement()
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 filterWrqBindingSet
getBindingSetForWrqAlias(java.lang.String wrqAlias)
Get the BindingSet for a user provided table expression aliasjava.util.List<org.w3c.dom.Element>
getBoundVariables()
java.lang.String
getNextTableSqlAlias()
Produce a new unique sql table alias for the current select scopeSqlFromSubSelect
getParent()
Access to parent select, may be null This is the namespace for table aliasesWrqBindingSet
getRepresentingBindingSet()
A BindingSet representing us as if we where a bnd:BindingSetjava.util.Set<StandardBindingSet>
getResolvedBindingSets()
java.util.LinkedList<WrsBindingItem>
getSelectedBindingItems()
org.w3c.dom.Element
getSelectElem()
SQLStatementWithParams
getSelectStatement()
WrqInfo
getWrqInfo()
WrqQueryBuilder
getWrqQueryBuilder()
Access to the current overall query
-
-
-
Field Detail
-
selectElem
protected final org.w3c.dom.Element selectElem
-
wrqQueryBuilder
protected final WrqQueryBuilder wrqQueryBuilder
-
parent
protected final SqlFromSubSelect parent
-
wrqInfo
protected final WrqInfo wrqInfo
-
rowStart
protected int rowStart
-
rowEnd
protected int rowEnd
-
resolvedBindingSets
protected java.util.Set<StandardBindingSet> resolvedBindingSets
-
representingBindingSet
protected WrqBindingSetFromDerivedTable representingBindingSet
-
bindingSetForWrqAlias
protected java.util.Map<java.lang.String,WrqBindingSet> bindingSetForWrqAlias
-
aliasCounter
protected int aliasCounter
-
wrqTransformRowLimitXsltStatic
protected static java.lang.String wrqTransformRowLimitXsltStatic
-
selectStatement
protected SQLStatementWithParams selectStatement
-
-
Constructor Detail
-
SqlFromSubSelect
public SqlFromSubSelect(WrqQueryBuilder wrqQueryBuilder, SqlFromSubSelect parent, org.w3c.dom.Element selectElem) throws java.lang.Exception
We are initialized for a full-select (SELECTSs connected with SET operators).- Parameters:
wrqQueryBuilder
-selectElem
-- Throws:
java.lang.Exception
-
-
Method Detail
-
createSelectStatement
protected void createSelectStatement() throws java.lang.Exception
Handles a "select-statement", i.e. a complete select- Throws:
java.lang.Exception
- See Also:
ISqlGenerator.getSelectStatement()
-
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 java.lang.Exception
Generates 'WHERE ' plus the filter- Throws:
javax.xml.xpath.XPathExpressionException
BindingException
java.lang.Exception
-
generateGroupingClause
protected void generateGroupingClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws java.lang.Exception
Generates Grouping clause- Throws:
java.lang.Exception
-
generateHavingClause
protected void generateHavingClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws javax.xml.xpath.XPathExpressionException, BindingException
Generates Having SQL clause- Parameters:
wrqInfo
-sqlStatement
-- Throws:
javax.xml.xpath.XPathExpressionException
BindingException
-
generateOrderClause
protected void generateOrderClause(WrqInfo wrqInfo, SQLStatementWithParams sqlStatement) throws BindingNotFoundException
Generates Order-By clause- Throws:
BindingNotFoundException
-
getBoundVariables
public java.util.List<org.w3c.dom.Element> getBoundVariables()
-
getSelectedBindingItems
public java.util.LinkedList<WrsBindingItem> getSelectedBindingItems()
-
getRepresentingBindingSet
public WrqBindingSet getRepresentingBindingSet() throws java.lang.Exception
A BindingSet representing us as if we where a bnd:BindingSet- Returns:
- Throws:
java.lang.Exception
-
getWrqInfo
public WrqInfo getWrqInfo()
-
getResolvedBindingSets
public java.util.Set<StandardBindingSet> getResolvedBindingSets()
-
getSelectStatement
public SQLStatementWithParams getSelectStatement()
-
getBindingSetForWrqAlias
public WrqBindingSet getBindingSetForWrqAlias(java.lang.String wrqAlias) throws BindingNotFoundException
Get the BindingSet for a user provided table expression alias- Parameters:
wrqAlias
-- Returns:
- Throws:
BindingNotFoundException
-
addBindingSetForWrqAlias
public void addBindingSetForWrqAlias(java.lang.String wrqAlias, WrqBindingSet bindingSet)
Set the BindingSet for a user provided table expression alias- Parameters:
wrqAlias
-bindingSet
-
-
getWrqQueryBuilder
public WrqQueryBuilder getWrqQueryBuilder()
Access to the current overall query- Returns:
-
getParent
public SqlFromSubSelect getParent()
Access to parent select, may be null This is the namespace for table aliases- Returns:
-
getNextTableSqlAlias
public java.lang.String getNextTableSqlAlias()
Produce a new unique sql table alias for the current select scope- Returns:
-
getSelectElem
public org.w3c.dom.Element getSelectElem()
-
-