类 SelectStatementBuilder


  • public class SelectStatementBuilder
    extends Object
    Largely a copy of the Select class, but changed up slightly to better meet needs of building a SQL SELECT statement from a LoadPlan
    作者:
    Steve Ebersole, Gavin King
    • 字段详细资料

      • dialect

        public final Dialect dialect
    • 构造器详细资料

      • SelectStatementBuilder

        public SelectStatementBuilder​(Dialect dialect)
        Constructs a select statement builder object.
        参数:
        dialect - The dialect.
    • 方法详细资料

      • appendSelectClauseFragment

        public void appendSelectClauseFragment​(String selection)
        Appends a select clause fragment
        参数:
        selection - The selection fragment
      • appendFromClauseFragment

        public void appendFromClauseFragment​(String fragment)
        Appends the from clause fragment.
        参数:
        fragment - The from cause fragment.
      • appendFromClauseFragment

        public void appendFromClauseFragment​(String tableName,
                                             String alias)
        Appends the specified table name and alias as a from clause fragment.
        参数:
        tableName - The table name.
        alias - The table alias.
      • appendRestrictions

        public void appendRestrictions​(String restrictions)
        Appends the specified restrictions after "cleaning" the specified value (by trimming and removing 'and ' from beginning and ' and' from the end). If the where clause already exists, this method ensure that ' and ' prefixes the cleaned restrictions.
        参数:
        restrictions - The restrictions.
      • setOuterJoins

        public void setOuterJoins​(String outerJoinsAfterFrom,
                                  String outerJoinsAfterWhere)
        Sets the outer join fragments to be added to the "from" and "where" clauses.
        参数:
        outerJoinsAfterFrom - The outer join fragment to be appended to the "from" clause.
        outerJoinsAfterWhere - The outer join fragment to be appended to the "where" clause.
      • appendOrderByFragment

        public void appendOrderByFragment​(String ordering)
        Appends the "order by" fragment, prefixed by a comma if the "order by" fragment already exists.
        参数:
        ordering - The "order by" fragment to append.
      • setComment

        public void setComment​(String comment)
        Sets the comment for the select statement.
        参数:
        comment - The comment.
      • setLockMode

        public void setLockMode​(LockMode lockMode)
        Sets the lock mode for the select statement.
        参数:
        lockMode - The lock mode.
      • setLockOptions

        public void setLockOptions​(LockOptions lockOptions)
        Sets the lock options for the select statement.
        参数:
        lockOptions - The lock options.
      • toStatementString

        public String toStatementString()
        Construct an SQL SELECT statement from the given clauses.
        返回:
        the SQL SELECT statement.