Package com.querydsl.sql.mysql
Class AbstractMySQLQuery<T,C extends AbstractMySQLQuery<T,C>>
java.lang.Object
com.querydsl.core.support.QueryBase<Q>
com.querydsl.core.support.FetchableQueryBase<T,Q>
com.querydsl.core.support.FetchableSubQueryBase<T,Q>
com.querydsl.sql.ProjectableSQLQuery<T,Q>
com.querydsl.sql.AbstractSQLQuery<T,C>
com.querydsl.sql.mysql.AbstractMySQLQuery<T,C>
- Type Parameters:
T- result typeC- 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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class com.querydsl.sql.AbstractSQLQuery
listeners, PARENT_CONTEXT, useLiteralsFields inherited from class com.querydsl.sql.ProjectableSQLQuery
configuration, firstUnionSubQuery, union, unionAllFields inherited from class com.querydsl.core.support.QueryBase
MDC_PARAMETERS, MDC_QUERY, queryMixin -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMySQLQuery(Connection conn, Configuration configuration, QueryMetadata metadata) AbstractMySQLQuery(Supplier<Connection> connProvider, Configuration configuration, QueryMetadata metadata) -
Method Summary
Modifier and TypeMethodDescriptionFor 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.SQL_BUFFER_RESULT forces the result to be put into a temporary table.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.SQL_CALC_FOUND_ROWS tells MySQL to calculate how many rows there would be in the result set, disregarding any LIMIT clause.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.HIGH_PRIORITY gives the SELECT higher priority than a statement that updates a table.ignoreIndex(String... indexes) The alternative syntax IGNORE INDEX (index_list) can be used to tell MySQL to not use some particular index or indexes.SELECT ...intoDumpfile(File file) SELECT ...intoOutfile(File file) SELECT ...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.noCache()With SQL_NO_CACHE, the server does not use the query cache.For SQL_SMALL_RESULT, MySQL uses fast temporary tables to store the resulting table instead of using sorting.STRAIGHT_JOIN forces the optimizer to join the tables in the order in which they are listed in the FROM clause.By specifying USE INDEX (index_list), you can tell MySQL to use only one of the named indexes to find rows in the table.The GROUP BY clause permits a WITH ROLLUP modifier that causes extra rows to be added to the summary output.Methods inherited from class com.querydsl.sql.AbstractSQLQuery
addListener, as, as, clone, clone, clone, createSerializer, endContext, fetch, fetchCount, fetchResults, forShare, forShare, forUpdate, getConfiguration, getResults, getResults, iterate, logQuery, onException, setParameters, setStatementOptions, setUseLiterals, startContextMethods inherited from class com.querydsl.sql.ProjectableSQLQuery
accept, addFlag, addFlag, addFlag, addFlag, addJoinFlag, addJoinFlag, fetchOne, from, from, from, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, getSQL, getSQL, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, on, on, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, serialize, toString, union, union, union, unionAll, unionAll, unionAll, with, with, with, withRecursive, withRecursive, withRecursiveMethods inherited from class com.querydsl.core.support.FetchableSubQueryBase
contains, contains, eq, eq, exists, getMetadata, getType, goe, goe, gt, gt, hashCode, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExistsMethods inherited from class com.querydsl.core.support.FetchableQueryBase
equals, fetchFirst, transform, uniqueResultMethods inherited from class com.querydsl.core.support.QueryBase
distinct, groupBy, groupBy, having, having, limit, offset, orderBy, orderBy, restrict, set, where, whereMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.querydsl.core.Fetchable
fetchFirst, streamMethods inherited from interface com.querydsl.core.FetchableQuery
select, select, transformMethods inherited from interface com.querydsl.core.FilteredClause
where
-
Field Details
-
WITH_ROLLUP
- See Also:
-
STRAIGHT_JOIN
- See Also:
-
SQL_SMALL_RESULT
- See Also:
-
SQL_NO_CACHE
- See Also:
-
LOCK_IN_SHARE_MODE
- See Also:
-
HIGH_PRIORITY
- See Also:
-
SQL_CALC_FOUND_ROWS
- See Also:
-
SQL_CACHE
- See Also:
-
SQL_BUFFER_RESULT
- See Also:
-
SQL_BIG_RESULT
- See Also:
-
-
Constructor Details
-
AbstractMySQLQuery
-
AbstractMySQLQuery
public AbstractMySQLQuery(Supplier<Connection> connProvider, Configuration configuration, QueryMetadata metadata)
-
-
Method Details
-
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
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
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
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
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
SELECT ... INTO var_list selects column values and stores them into variables.- Parameters:
var- variable name- Returns:
- the current object
-
intoDumpfile
SELECT ... INTO DUMPFILE writes a single row to a file without any formatting.- Parameters:
file- file to write to- Returns:
- the current object
-
intoOutfile
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
-
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
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
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
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
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
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
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
-