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
,java.io.Serializable
,java.lang.Cloneable
public class WrqBindingSetFromTableReference extends WrqBindingSetVirtual
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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.businesscode.bcdui.binding.BindingSet
BindingSet.SECURITY_OPS
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.String,java.lang.String>
connectorsTypes
protected java.util.Map<java.lang.String,BindingItem>
importedBindingItems
protected boolean
isAllowSelectAllColumns
protected static java.util.Map<java.lang.String,java.lang.String>
joinTypes
protected static long
serialVersionUID
-
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
Constructors Constructor Description WrqBindingSetFromTableReference(org.w3c.dom.NodeList fromChildNl, SqlFromSubSelect currentSelect, java.util.Set<java.lang.String> allRawBRefs, boolean selectAll)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTableFactor(org.w3c.dom.Element teElem, SQLStatementWithParams sqlStatementWithParams, java.util.Set<java.lang.String> allRawBRefs, boolean selectAll)
Adds the BindingItems for a table factor to the virtual one we are creatingprotected void
collectBindingItems(java.util.Set<java.lang.String> allRawBRefsWoRel, java.lang.String wrqAlias, boolean selectAll, BindingSet bs)
Collect all BindingItems requested from the underlying (maybe virtual) BindingSetprotected org.w3c.dom.Element
firstWrqChildElem(org.w3c.dom.Node elem)
Find first wrq:* childprotected org.w3c.dom.Element
followingWrqElem(org.w3c.dom.Node elem)
Find next wrq:* siblingBindingItem
get(java.lang.String key)
Per convention our bRefs have alias.bRef, where alias may be emptyjava.lang.String
getJdbcResourceName()
Gets the database name the table of the BindingSet is located in.SQLStatementWithParams
getSubjectFilterExpression(WrqInfo wrqInfo)
Return SubjectFilters to be applied for our virtual BindingSet It ANDs all SubjectFilters of StandardBindingSets appearing in our joinjava.util.List<java.lang.Class<? extends Modifier>>
getWrqModifiers()
All Modifiers attached to StandardBindingSets used by usprotected boolean
handleJoinCondition(org.w3c.dom.Element elem, java.lang.String connect, boolean isFirst)
Recursively handle join conditionsboolean
isAllowSelectAllColumns()
isAllowSelectAllColumns-
Methods 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 Detail
-
serialVersionUID
protected static final long serialVersionUID
- See Also:
- Constant Field Values
-
importedBindingItems
protected java.util.Map<java.lang.String,BindingItem> importedBindingItems
-
isAllowSelectAllColumns
protected boolean isAllowSelectAllColumns
-
joinTypes
protected static final java.util.Map<java.lang.String,java.lang.String> joinTypes
-
connectorsTypes
protected static final java.util.Map<java.lang.String,java.lang.String> connectorsTypes
-
-
Constructor Detail
-
WrqBindingSetFromTableReference
public WrqBindingSetFromTableReference(org.w3c.dom.NodeList fromChildNl, SqlFromSubSelect currentSelect, java.util.Set<java.lang.String> allRawBRefs, boolean selectAll) throws java.lang.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:
java.lang.Exception
-
-
Method Detail
-
handleJoinCondition
protected boolean handleJoinCondition(org.w3c.dom.Element elem, java.lang.String connect, boolean isFirst) throws BindingNotFoundException
Recursively handle join conditions- Parameters:
elem
-connect
-isFirst
-- Returns:
- Throws:
BindingNotFoundException
-
firstWrqChildElem
protected org.w3c.dom.Element firstWrqChildElem(org.w3c.dom.Node elem)
Find first wrq:* child- Parameters:
elem
-- Returns:
-
followingWrqElem
protected org.w3c.dom.Element followingWrqElem(org.w3c.dom.Node elem)
Find next wrq:* sibling- Parameters:
elem
-- Returns:
-
addTableFactor
protected void addTableFactor(org.w3c.dom.Element teElem, SQLStatementWithParams sqlStatementWithParams, java.util.Set<java.lang.String> allRawBRefs, boolean selectAll) throws java.lang.Exception
Adds the BindingItems for a table factor to the virtual one we are creating- Parameters:
teElem
-sqlStatementWithParams
-allRawBRefs
-selectAll
-- Throws:
java.lang.Exception
-
collectBindingItems
protected void collectBindingItems(java.util.Set<java.lang.String> allRawBRefsWoRel, java.lang.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
public BindingItem get(java.lang.String key) throws BindingNotFoundException
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
public java.util.List<java.lang.Class<? extends Modifier>> getWrqModifiers()
All Modifiers attached to StandardBindingSets used by us- Specified by:
getWrqModifiers
in interfaceBindingSet
- Overrides:
getWrqModifiers
in classWrqBindingSetVirtual
- Returns:
-
getSubjectFilterExpression
public SQLStatementWithParams getSubjectFilterExpression(WrqInfo wrqInfo) throws BindingException
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
public java.lang.String 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
-
-