Package de.businesscode.bcdui.wrs.load
Class WrqBindingSetFromTableReference
java.lang.Object
de.businesscode.bcdui.wrs.load.WrqBindingSetVirtual
de.businesscode.bcdui.wrs.load.WrqBindingSetFromTableReference
- All Implemented Interfaces:
BindingSet,WrqBindingSet,Serializable,Cloneable
Represents a virtual BindingSet resulting from the children of wrq:From, i.e. a table reference
A table reference can be a plain table name or joined tables factors,
i.e. table names, derived table expressions or references to CTE
Mostly it deals with the handling of wrq:Join, but for consistency we also take care for cases without
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.businesscode.bcdui.binding.BindingSet
BindingSet.SECURITY_OPS -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,BindingItem> protected booleanprotected static final longFields inherited from class de.businesscode.bcdui.wrs.load.WrqBindingSetVirtual
bindingItems, currentSelect, name, resolvedBindingSets, sqlAlias, sqlStatementWithParams, tableName, wrqModifiersFields inherited from interface de.businesscode.bcdui.binding.BindingSet
DEFAULT_DATABASE_SOURCENAME -
Constructor Summary
ConstructorsConstructorDescriptionWrqBindingSetFromTableReference(NodeList fromChildNl, SqlFromSubSelect currentSelect, Set<String> allRawBRefs, boolean selectAll) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTableFactor(Element teElem, SQLStatementWithParams sqlStatementWithParams, Set<String> allRawBRefs, boolean selectAll) Adds the BindingItems for a table factor to the virtual one we are creatingprotected voidcollectBindingItems(Set<String> allRawBRefsWoRel, String wrqAlias, boolean selectAll, BindingSet bs) Collect all BindingItems requested from the underlying (maybe virtual) BindingSetprotected ElementfirstWrqChildElem(Node elem) Find first wrq:* childprotected ElementfollowingWrqElem(Node elem) Find next wrq:* siblingPer convention our bRefs have alias.bRef, where alias may be emptyGets the database name the table of the BindingSet is located in.getSubjectFilterExpression(WrqInfo wrqInfo) Return SubjectFilters to be applied for our virtual BindingSet It ANDs all SubjectFilters of StandardBindingSets appearing in our joinAll Modifiers attached to StandardBindingSets used by usprotected booleanhandleJoinCondition(Element elem, String connect, boolean isFirst) Recursively handle join conditionsbooleanisAllowSelectAllColumnsMethods inherited from class de.businesscode.bcdui.wrs.load.WrqBindingSetVirtual
addRelation, assurePermissionDefined, assurePermitted, get, getBindingItemFromRelation, getBindingItemNames, getKeyBindingItems, getName, getRelations, getResolvedBindingSets, getSecurity, getSqlAlias, getSQLStatementWithParams, getSubjectFilters, getTableReference, getWriteProcessing, hasCustomItem, hasItem, hasKeyBindingItems, hasSubjectFilters, isBackendCanBypassSubjectFilter
-
Field Details
-
serialVersionUID
protected static final long serialVersionUID- See Also:
-
importedBindingItems
-
isAllowSelectAllColumns
protected boolean isAllowSelectAllColumns -
joinTypes
-
connectorsTypes
-
-
Constructor Details
-
WrqBindingSetFromTableReference
public WrqBindingSetFromTableReference(NodeList fromChildNl, SqlFromSubSelect currentSelect, Set<String> allRawBRefs, boolean selectAll) throws Exception Constructor- Parameters:
fromChildNl- - Children of wrq:FromcurrentSelect- - ContextallRawBRefs- - These bRefs we need at least. Important for BindingSetGroupsselectAll- - If true, we do not know all required BindingItems, probably we have an empty select list, just add all- Throws:
Exception
-
-
Method Details
-
handleJoinCondition
protected boolean handleJoinCondition(Element elem, String connect, boolean isFirst) throws BindingNotFoundException Recursively handle join conditions- Parameters:
elem-connect-isFirst-- Returns:
- Throws:
BindingNotFoundException
-
firstWrqChildElem
Find first wrq:* child- Parameters:
elem-- Returns:
-
followingWrqElem
Find next wrq:* sibling- Parameters:
elem-- Returns:
-
addTableFactor
protected void addTableFactor(Element teElem, SQLStatementWithParams sqlStatementWithParams, Set<String> allRawBRefs, boolean selectAll) throws Exception Adds the BindingItems for a table factor to the virtual one we are creating- Parameters:
teElem-sqlStatementWithParams-allRawBRefs-selectAll-- Throws:
Exception
-
collectBindingItems
protected void collectBindingItems(Set<String> allRawBRefsWoRel, String wrqAlias, boolean selectAll, BindingSet bs) throws BindingException Collect all BindingItems requested from the underlying (maybe virtual) BindingSet- Parameters:
allRawBRefsWoRel-wrqAlias-selectAll-bs-- Throws:
BindingException
-
get
Per convention our bRefs have alias.bRef, where alias may be empty- Specified by:
getin interfaceBindingSet- Overrides:
getin classWrqBindingSetVirtual- Parameters:
key- The name of the BindingItem.- Returns:
- A BindingItem with the specified name.
- Throws:
BindingNotFoundException- If there is no BindingItem with the denoted name.
-
getWrqModifiers
All Modifiers attached to StandardBindingSets used by us- Specified by:
getWrqModifiersin interfaceBindingSet- Overrides:
getWrqModifiersin classWrqBindingSetVirtual- Returns:
-
getSubjectFilterExpression
Return SubjectFilters to be applied for our virtual BindingSet It ANDs all SubjectFilters of StandardBindingSets appearing in our join- Specified by:
getSubjectFilterExpressionin interfaceWrqBindingSet- Specified by:
getSubjectFilterExpressionin classWrqBindingSetVirtual- Returns:
- Throws:
BindingException
-
isAllowSelectAllColumns
public boolean isAllowSelectAllColumns()Description copied from interface:BindingSetisAllowSelectAllColumns- Specified by:
isAllowSelectAllColumnsin interfaceBindingSet- Overrides:
isAllowSelectAllColumnsin classWrqBindingSetVirtual- Returns:
- true if it is allowed to select all columns from this BindingSet.
-
getJdbcResourceName
Description copied from interface:BindingSetGets the database name the table of the BindingSet is located in.- Specified by:
getJdbcResourceNamein interfaceBindingSet- Specified by:
getJdbcResourceNamein classWrqBindingSetVirtual- Returns:
- All tables need to be on the same database, so here we return one from a random resolved BindingSet
-