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 boolean
protected static final long
Fields inherited from class de.businesscode.bcdui.wrs.load.WrqBindingSetVirtual
bindingItems, currentSelect, name, resolvedBindingSets, sqlAlias, sqlStatementWithParams, tableName, wrqModifiers
Fields 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 void
addTableFactor
(Element teElem, SQLStatementWithParams sqlStatementWithParams, Set<String> allRawBRefs, boolean selectAll) Adds the BindingItems for a table factor to the virtual one we are creatingprotected void
collectBindingItems
(Set<String> allRawBRefsWoRel, String wrqAlias, boolean selectAll, BindingSet bs) Collect all BindingItems requested from the underlying (maybe virtual) BindingSetprotected Element
firstWrqChildElem
(Node elem) Find first wrq:* childprotected Element
followingWrqElem
(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 boolean
handleJoinCondition
(Element elem, String connect, boolean isFirst) Recursively handle join conditionsboolean
isAllowSelectAllColumnsMethods 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:
get
in interfaceBindingSet
- Overrides:
get
in 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:
getWrqModifiers
in interfaceBindingSet
- Overrides:
getWrqModifiers
in classWrqBindingSetVirtual
- Returns:
-
getSubjectFilterExpression
Return SubjectFilters to be applied for our virtual BindingSet It ANDs all SubjectFilters of StandardBindingSets appearing in our join- Specified by:
getSubjectFilterExpression
in interfaceWrqBindingSet
- Specified by:
getSubjectFilterExpression
in classWrqBindingSetVirtual
- Returns:
- Throws:
BindingException
-
isAllowSelectAllColumns
public boolean isAllowSelectAllColumns()Description copied from interface:BindingSet
isAllowSelectAllColumns- Specified by:
isAllowSelectAllColumns
in interfaceBindingSet
- Overrides:
isAllowSelectAllColumns
in classWrqBindingSetVirtual
- Returns:
- true if it is allowed to select all columns from this BindingSet.
-
getJdbcResourceName
Description copied from interface:BindingSet
Gets the database name the table of the BindingSet is located in.- Specified by:
getJdbcResourceName
in interfaceBindingSet
- Specified by:
getJdbcResourceName
in classWrqBindingSetVirtual
- Returns:
- All tables need to be on the same database, so here we return one from a random resolved BindingSet
-