Class 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
    • 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 -
      • 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
      • 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 -
      • 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:
      • importsContainItem

        public boolean importsContainItem​(java.lang.String key)
                                   throws BindingException
        importsContainItem
        Parameters:
        key -
        Returns:
        Throws:
        BindingException
      • 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 class java.lang.Object
        See Also:
        Object.toString()
      • getTableAlias

        public java.lang.String getTableAlias​(java.lang.String mainTableAlias)
      • isDefaultImport

        public boolean isDefaultImport()