Interface QuerySettings
-
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
public interface QuerySettings
-
-
Field Summary
Fields Modifier and Type Field Description static String
CALLABLE_NAMED_PARAMS_ENABLED
When enabled, specifies that Hibernate should attempt to map parameter names given in aProcedureCall
orStoredProcedureQuery
to named parameters of the JDBCCallableStatement
.static String
CRITERIA_COPY_TREE
When enabled, specifies that queries created viaEntityManager.createQuery(CriteriaQuery)
,EntityManager.createQuery(CriteriaUpdate)
orEntityManager.createQuery(CriteriaDelete)
must create a copy of the passed criteria query object such that the resultingQuery
object is not affected by mutation of the original criteria query.static String
CRITERIA_VALUE_HANDLING_MODE
By default, a criteria query produces SQL with a JDBC bind parameter for any value specified via the criteria query API, except when the value is passed viaCriteriaBuilder.literal(Object)
, in which case the value is "inlined" as a SQL literal.static String
DEFAULT_NULL_ORDERING
Specifies the default precedence of null values in the HQLORDER BY
clause, eithernone
,first
, orlast
, or an instance ofNullPrecedence
.static String
FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH
When pagination is used in combination with afetch join
applied to a collection or many-valued association, the limit must be applied in-memory instead of on the database.static String
IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE
This setting defines howImmutable
entities are handled when executing a bulk update query.static String
IN_CLAUSE_PARAMETER_PADDING
Determines how parameters occurring in a SQLIN
predicate are expanded.static String
NATIVE_IGNORE_JDBC_PARAMETERS
When set to true, indicates that ordinal parameters (represented by the '?' placeholder) in native queries will be ignored.static String
PORTABLE_INTEGER_DIVISION
Specifies that division of two integers should produce an integer on all databases.static String
QUERY_MULTI_TABLE_INSERT_STRATEGY
Defines the "global" strategy to use for handling HQL and Criteria insert queries.static String
QUERY_MULTI_TABLE_MUTATION_STRATEGY
Defines the "global" strategy to use for handling HQL and Criteria mutation queries.static String
QUERY_PLAN_CACHE_ENABLED
When enabled, specifies that query plans should be cached.static String
QUERY_PLAN_CACHE_MAX_SIZE
The maximum number of entries in the query interpretation cache.static String
QUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZE
Deprecated.this setting is not currently usedstatic String
QUERY_STARTUP_CHECKING
When enabled, specifies that named queries be checked during startup.static String
SEMANTIC_QUERY_PRODUCER
Specifies aHqlTranslator
to use for HQL query translation.static String
SEMANTIC_QUERY_TRANSLATOR
Specifies aSqmTranslatorFactory
to use for HQL query translation.
-
-
-
Field Detail
-
PORTABLE_INTEGER_DIVISION
static final String PORTABLE_INTEGER_DIVISION
Specifies that division of two integers should produce an integer on all databases. By default, integer division in HQL can produce a non-integer on Oracle, MySQL, or MariaDB.- Since:
- 6.5
- See Also:
- Constant Field Values
-
SEMANTIC_QUERY_PRODUCER
static final String SEMANTIC_QUERY_PRODUCER
Specifies aHqlTranslator
to use for HQL query translation.- See Also:
- Constant Field Values
-
SEMANTIC_QUERY_TRANSLATOR
static final String SEMANTIC_QUERY_TRANSLATOR
Specifies aSqmTranslatorFactory
to use for HQL query translation.- See Also:
- Constant Field Values
-
QUERY_MULTI_TABLE_MUTATION_STRATEGY
static final String QUERY_MULTI_TABLE_MUTATION_STRATEGY
Defines the "global" strategy to use for handling HQL and Criteria mutation queries. Specifies aSqmMultiTableMutationStrategy
..- See Also:
- Constant Field Values
-
QUERY_MULTI_TABLE_INSERT_STRATEGY
static final String QUERY_MULTI_TABLE_INSERT_STRATEGY
Defines the "global" strategy to use for handling HQL and Criteria insert queries. Specifies aSqmMultiTableInsertStrategy
.- See Also:
- Constant Field Values
-
QUERY_STARTUP_CHECKING
static final String QUERY_STARTUP_CHECKING
When enabled, specifies that named queries be checked during startup.By default, named queries are checked at startup.
Mainly intended for use in test environments.
-
CRITERIA_VALUE_HANDLING_MODE
static final String CRITERIA_VALUE_HANDLING_MODE
By default, a criteria query produces SQL with a JDBC bind parameter for any value specified via the criteria query API, except when the value is passed viaCriteriaBuilder.literal(Object)
, in which case the value is "inlined" as a SQL literal.This setting may be used to override this default behavior:
- the
"bind"
mode uses bind parameters to pass such values to JDBC, but - the
"inline"
mode inlines values as SQL literals.
In both modes:
- values specified using
literal()
are inlined, and - values specified using
CriteriaBuilder.parameter(Class)
to create acriteria parameter
andQuery.setParameter(jakarta.persistence.Parameter,Object)
to specify its argument are passed to JDBC using a bind parameter.
The default mode is
ValueHandlingMode.BIND
. - the
-
DEFAULT_NULL_ORDERING
static final String DEFAULT_NULL_ORDERING
Specifies the default precedence of null values in the HQLORDER BY
clause, eithernone
,first
, orlast
, or an instance ofNullPrecedence
.The default is
none
.
-
CRITERIA_COPY_TREE
static final String CRITERIA_COPY_TREE
When enabled, specifies that queries created viaEntityManager.createQuery(CriteriaQuery)
,EntityManager.createQuery(CriteriaUpdate)
orEntityManager.createQuery(CriteriaDelete)
must create a copy of the passed criteria query object such that the resultingQuery
object is not affected by mutation of the original criteria query.If disabled, it's assumed that the client does not mutate the criteria query after calling
createQuery()
. Thus, in the interest of performance, no copy is created.The default behavior depends on how Hibernate is bootstrapped:
- When bootstrapping Hibernate through the native bootstrap APIs, this setting is disabled, that is, no copy of the criteria query object is made.
- When bootstrapping Hibernate through the JPA SPI, this setting is enabled so that criteria query objects are copied, as required by the JPA specification.
- Since:
- 6.0
- See Also:
- Constant Field Values
-
NATIVE_IGNORE_JDBC_PARAMETERS
static final String NATIVE_IGNORE_JDBC_PARAMETERS
When set to true, indicates that ordinal parameters (represented by the '?' placeholder) in native queries will be ignored.By default, this is set to false, i.e. native queries will be checked for ordinal placeholders.
-
FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH
static final String FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH
When pagination is used in combination with afetch join
applied to a collection or many-valued association, the limit must be applied in-memory instead of on the database. This typically has terrible performance characteristics, and should be avoided.When enabled, this setting specifies that an exception should be thrown for any query which would result in the limit being applied in-memory.
By default, the exception is disabled, and the possibility of terrible performance is left as a problem for the client to avoid.
- Since:
- 5.2.13
- See Also:
- Constant Field Values
-
IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE
static final String IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE
This setting defines howImmutable
entities are handled when executing a bulk update query. Valid options are enumerated byImmutableEntityUpdateQueryHandlingMode
:"warning"
specifies that a warning log message is issued when an immutable entity is to be updated via a bulk update statement, and"exception"
specifies that aHibernateException
should be thrown.
By default, a warning is logged.
- Since:
- 5.2.17
- See Also:
ImmutableEntityUpdateQueryHandlingMode
, Constant Field Values
-
IN_CLAUSE_PARAMETER_PADDING
static final String IN_CLAUSE_PARAMETER_PADDING
Determines how parameters occurring in a SQLIN
predicate are expanded. By default, theIN
predicate expands to include sufficient bind parameters to accommodate the specified arguments.However, for database systems supporting execution plan caching, there's a better chance of hitting the cache if the number of possible
IN
clause parameter list lengths is smaller.When this setting is enabled, we expand the number of bind parameters to an integer power of two: 4, 8, 16, 32, 64. Thus, if 5, 6, or 7 arguments are bound to a parameter, a SQL statement with 8 bind parameters in the
IN
clause will be used, and null will be bound to the left-over parameters.- Since:
- 5.2.17
- See Also:
- Constant Field Values
-
CALLABLE_NAMED_PARAMS_ENABLED
static final String CALLABLE_NAMED_PARAMS_ENABLED
When enabled, specifies that Hibernate should attempt to map parameter names given in aProcedureCall
orStoredProcedureQuery
to named parameters of the JDBCCallableStatement
.- Since:
- 6.0
- See Also:
SessionFactoryOptions.isUseOfJdbcNamedParametersEnabled()
, Constant Field Values
-
QUERY_PLAN_CACHE_ENABLED
static final String QUERY_PLAN_CACHE_ENABLED
When enabled, specifies that query plans should be cached.By default, the query plan cache is disabled, unless one of the configuration properties "hibernate.query.plan_cache_max_size" or "hibernate.query.plan_parameter_metadata_max_size" is set.
- See Also:
- Constant Field Values
-
QUERY_PLAN_CACHE_MAX_SIZE
static final String QUERY_PLAN_CACHE_MAX_SIZE
The maximum number of entries in the query interpretation cache.The default maximum is 2048.
- See Also:
QueryInterpretationCache
, Constant Field Values
-
QUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZE
@Deprecated(since="6.0") static final String QUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZE
Deprecated.this setting is not currently usedThe maximum number ofParameterMetadata
instances maintained by theQueryInterpretationCache
.- See Also:
- Constant Field Values
-
-