Class AbstractMySQLQuery<T,C extends AbstractMySQLQuery<T,C>>

Type Parameters:
T - result type
C - the concrete subtype
All Implemented Interfaces:
Fetchable<T>, FetchableQuery<T,C>, FilteredClause<C>, Query<C>, SimpleQuery<C>, ExtendedSubQuery<T>, Expression<T>, SubQueryExpression<T>, SQLCommonQuery<C>, Serializable
Direct Known Subclasses:
MySQLQuery

public abstract class AbstractMySQLQuery<T,C extends AbstractMySQLQuery<T,C>> extends AbstractSQLQuery<T,C>
MySQLQuery provides MySQL related extensions to SQLQuery.
Author:
tiwe
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • bigResult

      public C bigResult()
      For SQL_BIG_RESULT, MySQL directly uses disk-based temporary tables if needed, and prefers sorting to using a temporary table with a key on the GROUP BY elements.
      Returns:
      the current object
    • bufferResult

      public C bufferResult()
      SQL_BUFFER_RESULT forces the result to be put into a temporary table. This helps MySQL free the table locks early and helps in cases where it takes a long time to send the result set to the client. This option can be used only for top-level SELECT statements, not for subqueries or following UNION.
      Returns:
      the current object
    • cache

      public C cache()
      SQL_CACHE tells MySQL to store the result in the query cache if it is cacheable and the value of the query_cache_type system variable is 2 or DEMAND.
      Returns:
      the current object
    • calcFoundRows

      public C calcFoundRows()
      SQL_CALC_FOUND_ROWS tells MySQL to calculate how many rows there would be in the result set, disregarding any LIMIT clause. The number of rows can then be retrieved with SELECT FOUND_ROWS().
      Returns:
      the current object
    • highPriority

      public C highPriority()
      HIGH_PRIORITY gives the SELECT higher priority than a statement that updates a table. You should use this only for queries that are very fast and must be done at once.
      Returns:
      the current object
    • into

      public C into(String var)
      SELECT ... INTO var_list selects column values and stores them into variables.
      Parameters:
      var - variable name
      Returns:
      the current object
    • intoDumpfile

      public C intoDumpfile(File file)
      SELECT ... INTO DUMPFILE writes a single row to a file without any formatting.
      Parameters:
      file - file to write to
      Returns:
      the current object
    • intoOutfile

      public C intoOutfile(File file)
      SELECT ... INTO OUTFILE writes the selected rows to a file. Column and line terminators c an be specified to produce a specific output format.
      Parameters:
      file - file to write to
      Returns:
      the current object
    • lockInShareMode

      public C lockInShareMode()
      Using LOCK IN SHARE MODE sets a shared lock that permits other transactions to read the examined rows but not to update or delete them.
      Returns:
      the current object
    • noCache

      public C noCache()
      With SQL_NO_CACHE, the server does not use the query cache. It neither checks the query cache to see whether the result is already cached, nor does it cache the query result.
      Returns:
      the current object
    • smallResult

      public C smallResult()
      For SQL_SMALL_RESULT, MySQL uses fast temporary tables to store the resulting table instead of using sorting. This should not normally be needed.
      Returns:
      the current object
    • straightJoin

      public C straightJoin()
      STRAIGHT_JOIN forces the optimizer to join the tables in the order in which they are listed in the FROM clause. You can use this to speed up a query if the optimizer joins the tables in nonoptimal order. STRAIGHT_JOIN also can be used in the table_references list.
      Returns:
      the current object
    • forceIndex

      public C forceIndex(String... indexes)
      You can use FORCE INDEX, which acts like USE INDEX (index_list) but with the addition that a table scan is assumed to be very expensive. In other words, a table scan is used only if there is no way to use one of the given indexes to find rows in the table.
      Parameters:
      indexes - index names
      Returns:
      the current object
    • ignoreIndex

      public C ignoreIndex(String... indexes)
      The alternative syntax IGNORE INDEX (index_list) can be used to tell MySQL to not use some particular index or indexes.
      Parameters:
      indexes - index names
      Returns:
      the current object
    • useIndex

      public C useIndex(String... indexes)
      By specifying USE INDEX (index_list), you can tell MySQL to use only one of the named indexes to find rows in the table.
      Parameters:
      indexes - index names
      Returns:
      the current object
    • withRollup

      public C withRollup()
      The GROUP BY clause permits a WITH ROLLUP modifier that causes extra rows to be added to the summary output. These rows represent higher-level (or super-aggregate) summary operations. ROLLUP thus enables you to answer questions at multiple levels of analysis with a single query. It can be used, for example, to provide support for OLAP (Online Analytical Processing) operations.
      Returns:
      the current object