Class Relation
- java.lang.Object
-
- de.businesscode.bcdui.binding.rel.Relation
-
public class Relation extends java.lang.Object
Relations are defined for a BindingSet in its config file. They are transparent to the client The related BindingSet is automatically joined, if one of its items is requested while the main BindingSet is queried Often this will be joined reference data tables
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Relation.TYPE
-
Constructor Summary
Constructors Constructor Description Relation(org.w3c.dom.Element relationElement, BindingSet pLeftBindingSet, int idx)
ConstructorRelation(org.w3c.dom.Element relationElement, java.lang.String pLeftBindingSetName, int idx)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getAllImportItemNames()
getAllImportItemNamesCondition
getCondition()
getConditionjava.lang.String
getConditionStatement(java.lang.String mainTableAlias, boolean isForJoinToCaseWhen)
returns statement created by own conditionjava.lang.String
getId()
getIdBindingItemFromRel
getImportItemByName(java.lang.String key)
getImportItemByNamejava.util.List<BindingItemFromRel>
getImportItems()
getImportItemsjava.lang.String
getJoinAsString()
gets join stringBindingSet
getLeftBindingSet()
getLeftBindingSetjava.lang.String
getLeftBindingSetName()
getLeftBindingSetNamejava.lang.String
getRelationStatement(java.lang.String mainTableAlias)
builds SQL statement for the relation like: LEFT OUTER JOIN ...tableName ...aliasName ON ( ...here condition statement )java.lang.String
getRightBindingSetName()
StandardBindingSet
getSourceBindingSet()
Method getSourceBindingSetjava.lang.String
getTableAlias(java.lang.String mainTableAlias)
Relation.TYPE
getType()
Method getTypeboolean
importsContainItem(java.lang.String key)
importsContainItemvoid
initRelation(org.w3c.dom.Element relationElement)
initializes all children of relationboolean
isDefaultImport()
boolean
isLeftOuter()
Method isLeftOuterboolean
isRightOuter()
Method isRightOutervoid
setCondition(Condition pcondition)
Method setConditionvoid
setId(java.lang.String pname)
setIdvoid
setLeftBindingSet(StandardBindingSet pLeftBindingSet)
setLeftBindingSetvoid
setLeftBindingSetName(java.lang.String pLeftBindingSetName)
setLeftBindingSetNameprotected void
setRightBindingSetName(java.lang.String pRightBindingSetName)
setRightBindingSetNamevoid
setSourceBindingSet(StandardBindingSet psourceBindingSet)
Method setSourceBindingSetvoid
setType(Relation.TYPE ptype)
Method setTypejava.lang.String
toString()
-
-
-
Constructor Detail
-
Relation
public Relation(org.w3c.dom.Element relationElement, java.lang.String pLeftBindingSetName, int idx) throws javax.xml.xpath.XPathExpressionException, BindingException
Constructor- Parameters:
relationElement
-pLeftBindingSetName
-- Throws:
javax.xml.xpath.XPathExpressionException
BindingException
-
Relation
public Relation(org.w3c.dom.Element relationElement, BindingSet pLeftBindingSet, int idx) throws javax.xml.xpath.XPathExpressionException, BindingException
Constructor- Parameters:
relationElement
-pLeftBindingSet
-- Throws:
javax.xml.xpath.XPathExpressionException
BindingException
-
-
Method Detail
-
getLeftBindingSetName
public java.lang.String getLeftBindingSetName()
getLeftBindingSetName- Returns:
-
setLeftBindingSetName
public void setLeftBindingSetName(java.lang.String pLeftBindingSetName)
setLeftBindingSetName- Parameters:
pLeftBindingSetName
-
-
getLeftBindingSet
public BindingSet getLeftBindingSet() throws BindingException
getLeftBindingSet- Returns:
- Throws:
BindingException
-
setLeftBindingSet
public void setLeftBindingSet(StandardBindingSet pLeftBindingSet)
setLeftBindingSet- Parameters:
pLeftBindingSet
-
-
getId
public java.lang.String getId()
getId- Returns:
-
setId
public void setId(java.lang.String pname)
setId- Parameters:
pname
-
-
getRightBindingSetName
public java.lang.String getRightBindingSetName()
-
initRelation
public void initRelation(org.w3c.dom.Element relationElement) throws javax.xml.xpath.XPathExpressionException, BindingException
initializes all children of relation- Parameters:
relationElement
-- Throws:
javax.xml.xpath.XPathExpressionException
BindingException
-
getCondition
public Condition getCondition() throws BindingException
getCondition- Returns:
- Throws:
javax.xml.xpath.XPathExpressionException
BindingException
-
setCondition
public void setCondition(Condition pcondition)
Method setCondition- Parameters:
pcondition
-
-
getType
public Relation.TYPE getType()
Method getType- Returns:
-
setType
public void setType(Relation.TYPE ptype)
Method setType- Parameters:
ptype
-
-
getSourceBindingSet
public StandardBindingSet getSourceBindingSet()
Method getSourceBindingSet- Returns:
- Throws:
BindingException
-
setSourceBindingSet
public void setSourceBindingSet(StandardBindingSet psourceBindingSet)
Method setSourceBindingSet- Parameters:
psourceBindingSet
-
-
isLeftOuter
public boolean isLeftOuter()
Method isLeftOuter- Returns:
-
isRightOuter
public boolean isRightOuter()
Method isRightOuter- Returns:
-
getConditionStatement
public java.lang.String getConditionStatement(java.lang.String mainTableAlias, boolean isForJoinToCaseWhen) throws BindingException
returns statement created by own condition- Returns:
- Throws:
BindingException
-
getJoinAsString
public java.lang.String getJoinAsString()
gets join string- Returns:
-
getImportItems
public java.util.List<BindingItemFromRel> getImportItems() throws BindingNotFoundException
getImportItems- Returns:
- Throws:
BindingException
BindingNotFoundException
-
importsContainItem
public boolean importsContainItem(java.lang.String key) throws BindingException
importsContainItem- Parameters:
key
-- Returns:
- Throws:
BindingException
-
getImportItemByName
public BindingItemFromRel getImportItemByName(java.lang.String key) throws BindingException
getImportItemByName- Parameters:
key
-- Returns:
- null if not found
- Throws:
BindingException
-
getAllImportItemNames
public java.util.List<java.lang.String> getAllImportItemNames() throws BindingNotFoundException
getAllImportItemNames- Returns:
- Throws:
BindingException
BindingNotFoundException
-
getRelationStatement
public java.lang.String getRelationStatement(java.lang.String mainTableAlias) throws BindingException
builds SQL statement for the relation like: LEFT OUTER JOIN ...tableName ...aliasName ON ( ...here condition statement )- Throws:
BindingException
-
setRightBindingSetName
protected void setRightBindingSetName(java.lang.String pRightBindingSetName)
setRightBindingSetName- Parameters:
pRightBindingSetName
-
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
getTableAlias
public java.lang.String getTableAlias(java.lang.String mainTableAlias)
-
isDefaultImport
public boolean isDefaultImport()
-
-