Interface QuerySettings
- All Known Subinterfaces:
AvailableSettings
- All Known Implementing Classes:
Environment
public interfaceQuerySettings
Field Summary
Fields Modifier and Type Field Description staticStringCALLABLE_NAMED_PARAMS_ENABLEDWhen enabled, specifies that Hibernate should attempt to map parameter names given in aProcedureCallorStoredProcedureQueryto named parameters of the JDBCCallableStatement.staticStringCRITERIA_COPY_TREEWhen enabled, specifies thatqueries created viaEntityManager.createQuery(CriteriaQuery),EntityManager.createQuery(CriteriaUpdate)orEntityManager.createQuery(CriteriaDelete)must create a copy of the passed criteria query object such that the resultingQueryobject is not affected by mutation of the originalcriteria query.staticStringCRITERIA_VALUE_HANDLING_MODEBy default, acriteria 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.staticStringDEFAULT_NULL_ORDERINGSpecifies the defaultprecedence of null values in the HQLORDER BYclause, eithernone,first, orlast, or an instance ofNullPrecedence.staticStringFAIL_ON_PAGINATION_OVER_COLLECTION_FETCHWhenpagination is used in combination with afetch joinapplied to a collection or many-valued association, the limit must be applied in-memory instead of on the database.staticStringIMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODEThis setting defines howImmutableentities are handled when executing a bulk update query.staticStringIN_CLAUSE_PARAMETER_PADDINGDetermines how parameters occurring in a SQLINpredicate are expanded.staticStringNATIVE_IGNORE_JDBC_PARAMETERSWhen enabled, ordinal parameters (represented by the?placeholder) in native queries will be ignored.staticStringPORTABLE_INTEGER_DIVISIONSpecifies that division of two integers should produce an integer on all databases.staticStringQUERY_MULTI_TABLE_INSERT_STRATEGYDefines the "global" strategy to use for handling HQL and Criteria insert queries.staticStringQUERY_MULTI_TABLE_MUTATION_STRATEGYDefines the "global" strategy to use for handling HQL and Criteria mutation queries.staticStringQUERY_PASS_PROCEDURE_PARAMETER_NAMESFor database supporting name parameters this setting allows to use named parameter is the procedure call.staticStringQUERY_PLAN_CACHE_ENABLEDWhen enabled, specifies thatquery plans should becached.staticStringQUERY_PLAN_CACHE_MAX_SIZEThe maximum number of entries in thequery interpretation cache.staticStringQUERY_PLAN_CACHE_PARAMETER_METADATA_MAX_SIZEDeprecated.this setting is not currently usedstaticStringQUERY_STARTUP_CHECKINGWhen enabled, specifies that named queries be checked during startup.staticStringSEMANTIC_QUERY_PRODUCERSpecifies aHqlTranslatorto use for HQL query translation.staticStringSEMANTIC_QUERY_TRANSLATORSpecifies aSqmTranslatorFactoryto 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
- Default Value:
false
SEMANTIC_QUERY_PRODUCER
static final String SEMANTIC_QUERY_PRODUCER
Specifies aHqlTranslatorto use for HQL query translation.- See Also:
- Constant Field Values
SEMANTIC_QUERY_TRANSLATOR
static final String SEMANTIC_QUERY_TRANSLATOR
Specifies aSqmTranslatorFactoryto 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.Mainly intended for use in test environments.
- See Also:
SessionFactoryBuilder.applyNamedQueryCheckingOnStartup(boolean),Constant Field Values- Default Value:
true(enabled) - named queries are checked at startup.
CRITERIA_VALUE_HANDLING_MODE
static final String CRITERIA_VALUE_HANDLING_MODE
By default, acriteria 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 parameterandQuery.setParameter(jakarta.persistence.Parameter,Object)to specify its argument are passed to JDBC using a bind parameter.
- the
DEFAULT_NULL_ORDERING
static final String DEFAULT_NULL_ORDERING
Specifies the defaultprecedence of null values in the HQLORDER BYclause, eithernone,first, orlast, or an instance ofNullPrecedence.- See Also:
NullPrecedence,SessionFactoryBuilder.applyDefaultNullPrecedence(NullPrecedence),Constant Field Values- Default Value:
none.
CRITERIA_COPY_TREE
static final String CRITERIA_COPY_TREE
When enabled, specifies thatqueries created viaEntityManager.createQuery(CriteriaQuery),EntityManager.createQuery(CriteriaUpdate)orEntityManager.createQuery(CriteriaDelete)must create a copy of the passed criteria query object such that the resultingQueryobject is not affected by mutation of the originalcriteria 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 enabled, ordinal parameters (represented by the?placeholder) in native queries will be ignored.- See Also:
SessionFactoryOptions.getNativeJdbcParametersIgnored(),Constant Field Values- Default Value:
false(disabled) - native queries are checked for ordinal placeholders.
FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH
static final String FAIL_ON_PAGINATION_OVER_COLLECTION_FETCH
Whenpagination is used in combination with afetch joinapplied 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.
- Since:
- 5.2.13
- See Also:
- Constant Field Values
- Default Value:
false(disabled) - no exception is thrown and the possibility of terrible performance is left as a problem for the client to avoid.
IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE
static final String IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE
This setting defines howImmutableentities are handled when executing a bulk update query. Valid options are enumerated byImmutableEntityUpdateQueryHandlingMode:"warning"specifies that a warning log message is issued when animmutable entity is to be updated via a bulk update statement, and"exception"specifies that aHibernateExceptionshould be thrown.
- Since:
- 5.2.17
- See Also:
ImmutableEntityUpdateQueryHandlingMode,Constant Field Values- Default Value:
"warning"
IN_CLAUSE_PARAMETER_PADDING
static final String IN_CLAUSE_PARAMETER_PADDING
Determines how parameters occurring in a SQLINpredicate are expanded. By default, theINpredicate 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
INclause 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
INclause 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 aProcedureCallorStoredProcedureQueryto named parameters of the JDBCCallableStatement.
QUERY_PLAN_CACHE_ENABLED
static final String QUERY_PLAN_CACHE_ENABLED
When enabled, specifies thatquery plans should becached.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 thequery interpretation cache.The default maximum is2048.
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 ofParameterMetadatainstances maintained by theQueryInterpretationCache.- See Also:
- Constant Field Values
QUERY_PASS_PROCEDURE_PARAMETER_NAMES
static final String QUERY_PASS_PROCEDURE_PARAMETER_NAMES
For database supporting name parameters this setting allows to use named parameter is the procedure call. By default, this is set to false- See Also:
- Constant Field Values