Class AbstractIdentificationVariableDeclarationStateObject

    • Constructor Detail

      • AbstractIdentificationVariableDeclarationStateObject

        protected AbstractIdentificationVariableDeclarationStateObject​(AbstractFromClauseStateObject parent)
        Creates a new AbstractIdentificationVariableDeclarationStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • AbstractIdentificationVariableDeclarationStateObject

        protected AbstractIdentificationVariableDeclarationStateObject​(AbstractFromClauseStateObject parent,
                                                                       java.lang.String root,
                                                                       java.lang.String identificationVariable)
        Creates a new AbstractIdentificationVariableDeclarationStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        root - The "root" object
        identificationVariable - The identification variable defining the given path
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • addInnerJoin

        public JoinStateObject addInnerJoin​(java.lang.String path,
                                            java.lang.String identificationVariable)
        Adds a new INNER JOIN expression to this declaration.
        Parameters:
        path - The join association path expression
        identificationVariable - The new variable defining the join association path
        Returns:
        A new JoinStateObject
      • addJoin

        public JoinStateObject addJoin​(java.lang.String joinType)
        Adds a new JOIN expression to this declaration.
        Parameters:
        joinType - One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN
        Returns:
        A new JoinStateObject
      • addJoin

        public JoinStateObject addJoin​(java.lang.String joinType,
                                       java.util.ListIterator<java.lang.String> paths,
                                       java.lang.String identificationVariable)
        Adds a new JOIN expression to this declaration.
        Parameters:
        joinType - One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN
        paths - The join association path expression
        identificationVariable - The new variable defining the join association path
        Returns:
        A new JoinStateObject
      • addJoin

        public JoinStateObject addJoin​(java.lang.String path,
                                       java.lang.String identificationVariable)
        Adds a new JOIN expression to this declaration.
        Parameters:
        path - The join association path expression
        identificationVariable - The new variable defining the join association path
        Returns:
        A new JoinStateObject
      • addJoin

        public JoinStateObject addJoin​(java.lang.String joinType,
                                       java.lang.String path,
                                       java.lang.String identificationVariable)
        Adds a new JOIN expression to this declaration.
        Parameters:
        joinType - One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN
        path - The join association path expression
        identificationVariable - The new variable defining the join association path
        Returns:
        A new JoinStateObject
      • addLeftJoin

        public JoinStateObject addLeftJoin​(java.lang.String path,
                                           java.lang.String identificationVariable)
        Adds a new LEFT JOIN expression to this declaration.
        Parameters:
        path - The join association path expression
        identificationVariable - The new variable defining the join association path
        Returns:
        A new JoinStateObject
      • addLeftOuterJoin

        public JoinStateObject addLeftOuterJoin​(java.lang.String path,
                                                java.lang.String identificationVariable)
        Adds a new LEFT OUTER JOIN expression to this declaration.
        Parameters:
        path - The join association path expression
        identificationVariable - The new variable defining the join association path
        Returns:
        A new JoinStateObject
      • getIdentificationVariable

        public java.lang.String getIdentificationVariable()
        Returns the identification variable identifying the "root".
        Returns:
        A case insensitive unique identifier declaring the "root" of the declaration
      • getRootPath

        public java.lang.String getRootPath()
        Returns the "root" object for objects which may not be reachable by navigation.
        Returns:
        The "root" object
      • getRootStateObject

        public StateObject getRootStateObject()
        Returns the StateObject representing the "root" for objects which may not be reachable by navigation.
        Returns:
        The StateObject representing one of the possible valid "root"
      • parseJoin

        public void parseJoin​(java.lang.String jpqlFragment)
        Parses the given JPQL fragment that should contain a single JOIN expression.
        Parameters:
        jpqlFragment - The portion representing a JOIN expression
      • setExpression

        public void setExpression​(IdentificationVariableDeclaration expression)
        Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.
        Parameters:
        expression - The parsed object representing an identification variable declaration
      • setIdentificationVariable

        public void setIdentificationVariable​(java.lang.String identificationVariable)
        Sets the new identification variable that will range over the "root".
        Parameters:
        identificationVariable - The new identification variable
      • setRootPath

        public void setRootPath​(java.lang.String root)
        Sets the "root" object for objects which may not be reachable by navigation.
        Parameters:
        root - The "root" object
      • toTextInternal

        protected void toTextInternal​(java.lang.Appendable writer)
                               throws java.io.IOException
        Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
        Specified by:
        toTextInternal in class AbstractStateObject
        Parameters:
        writer - The writer used to print out the string representation
        Throws:
        java.io.IOException - This should never happens, it is only required because Appendable is used instead of any concrete class