Class Expression

    • Field Detail

      • properties

        @Inject
        protected PdbProperties properties
        The PDB properties.
      • alias

        protected String alias
        The expression alias if applicable.
      • enclosed

        protected boolean enclosed
        True if the expression is to be enclosed in parenthesis.
      • quotes

        protected boolean quotes
        True if the expression is to be put around quotes.
      • ordering

        protected String ordering
        The string that specified the ordering if applicable.
      • joins

        protected final List<Join> joins
        The list of joins, if applicable.
      • withNoLock

        protected boolean withNoLock
        The SQL Server's no lock keyword.
    • Constructor Detail

      • Expression

        public Expression()
    • Method Detail

      • translate

        public abstract String translate()
        Translates the expression.
        Returns:
        A translation of the implementing expression.
      • alias

        public Expression alias​(String alias)
        Aliases this expression.
        Parameters:
        alias - The alias.
        Returns:
        This expression.
      • unquote

        public Expression unquote()
        Removes the quotes for this expression.
        Returns:
        This expression.
      • enclose

        public Expression enclose()
        Encloses this expression with parenthesis.
        Returns:
        This expression.
      • asc

        public Expression asc()
        Sets ordering to ascendant.
        Returns:
        This expression.
      • desc

        public Expression desc()
        Sets ordering to descendant.
        Returns:
        This expression.
      • isEnclosed

        public boolean isEnclosed()
        Checks if this expression is to be enclosed in parenthesis.
        Returns:
        true if this expression is enclosed, false otherwise.
      • isQuote

        public boolean isQuote()
        Checks if this expression is to be quoted.
        Returns:
        true if this expression is quoted, false otherwise.
      • isAliased

        public boolean isAliased()
        Checks if this expression is to be aliased.
        Returns:
        true if this expression is aliased, false otherwise.
      • innerJoin

        public Expression innerJoin​(Expression table,
                                    Expression expr)
        Sets an inner join with the current table.
        Parameters:
        table - The table to join.
        expr - The expressions to join.
        Returns:
        This expression.
      • leftOuterJoin

        public Expression leftOuterJoin​(Expression table,
                                        Expression expr)
        Sets a left outer join with the current table.
        Parameters:
        table - The table to join.
        expr - The expressions to join.
        Returns:
        This expression.
      • rightOuterJoin

        public Expression rightOuterJoin​(Expression table,
                                         Expression expr)
        Sets a right outer join with the current table.
        Parameters:
        table - The table to join.
        expr - The expressions to join.
        Returns:
        This expression.
      • fullOuterJoin

        public Expression fullOuterJoin​(Expression table,
                                        Expression expr)
        Sets a full outer join with the current table.
        Parameters:
        table - The table to join.
        expr - The expressions to join.
        Returns:
        This expression.
      • withNoLock

        public Expression withNoLock()
        Sets no lock keyword on SQL Server tables.
        Returns:
        This expression.
      • isWithNoLock

        public boolean isWithNoLock()
        Checks if this expression (TABLES) is with no lock.
        Returns:
        true if this expression (TABLE) is with no lock, false otherwise.
      • getJoins

        public List<Join> getJoins()
        Gets the join list.
        Returns:
        The join list.
      • getOrdering

        public String getOrdering()
        Gets the ordering.
        Returns:
        The ordering.
      • isQuotes

        public boolean isQuotes()
        Checks if this expression is to be translated with quotes.
        Returns:
        true if this expression is to be translated with quotes, false otherwise.
      • getAlias

        public String getAlias()
        Gets the alias.
        Returns:
        The alias, null if not applicable.