23.7. Query settings
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 60%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top">
Property
</td>
<td class="tableblock halign-left valign-top">
Example
</td>
<td class="tableblock halign-left valign-top">
Purpose
</td>
</tr>
<tr>
<td class="tableblock halign-left valign-top">
`hibernate.query.plan_cache_max_size`
</td>
<td class="tableblock halign-left valign-top">
`2048` (default value)
</td>
<td class="tableblock halign-left valign-top"><div><div class="paragraph">
The maximum number of entries including:
</div>
<div class="ulist">
HQLQueryPlanFilterQueryPlanNativeSQLQueryPlan</div>maintained by
QueryPlanCache.</div></div></td> </tr>
hibernate.query.plan_parameter_metadata_max_size</td>128(default value) </td>The maximum number of strong references associated with
ParameterMetadatamaintained byQueryPlanCache. </td> </tr>hibernate.order_by.default_null_ordering</td>none,firstorlast</td>Defines precedence of null values in
ORDER BYclause. Defaults tononewhich varies between RDBMS implementation. </td> </tr>hibernate.discriminator.force_in_select</td>trueorfalse(default value) </td>For entities which do not explicitly say, should we force discriminators into SQL selects? </td> </tr>
hibernate.query.substitutions</td>true=1,false=0</td>A comma-separated list of token substitutions to use when translating a Hibernate query to SQL. </td> </tr>
hibernate.query.factory_class</td>org.hibernate.hql.internal.ast. ASTQueryTranslatorFactory(default value) ororg.hibernate.hql.internal.classic. ClassicQueryTranslatorFactory</td>Chooses the HQL parser implementation. </td> </tr>
hibernate.query.jpaql_strict_compliance</td>trueorfalse(default value) </td>Map from tokens in Hibernate queries to SQL tokens, such as function or literal names.
Should we strictly adhere to JPA Query Language (JPQL) syntax, or more broadly support all of Hibernate’s superset (HQL)?
Setting this to
truemay cause valid HQL to throw an exception because it violates the JPQL subset. </td> </tr>hibernate.query.startup_check</td>true(default value) orfalse</td>Should named queries be checked during startup? </td> </tr>
hibernate.proc.param_null_passing</td>trueorfalse(default value) </td>Global setting for whether
nullparameter bindings should be passed to database procedure/function calls as part ofProcedureCallhandling. Implicitly Hibernate will not pass thenull, the intention being to allow any default argument values to be applied.This defines a global setting, which can then be controlled per parameter via
org.hibernate.procedure.ParameterRegistration#enablePassingNulls(boolean)Values are
true(pass the NULLs) orfalse(do not pass the NULLs). </td> </tr>hibernate.jdbc.log.warnings</td>trueorfalse</td>Enable fetching JDBC statement warning for logging. Default value is given by
org.hibernate.dialect.Dialect#isJdbcLogWarningsEnabledByDefault(). </td> </tr>hibernate.session_factory.statement_inspector</td>A fully-qualified class name, an instance, or a
Classobject reference </td>Names a
StatementInspectorimplementation to be applied to everySessioncreated by the currentSessionFactory.</div>
Can reference
</div>
StatementInspectorinstanceStatementInspectorimplementation {@link Class} referenceStatementInspectorimplementation class name (fully-qualified class name) </div></div></td> </tr>Multi-table bulk HQL operations </td> </tr>
hibernate.hql.bulk_id_strategy</td>A fully-qualified class name, an instance, or a
Classobject reference </td>Provide a custom
org.hibernate.hql.spi.id.MultiTableBulkIdStrategyimplementation for handling multi-table bulk HQL operations. </td> </tr>hibernate.hql.bulk_id_strategy.global_temporary.drop_tables</td>trueorfalse(default value) </td>For databases that don’t support local tables, but just global ones, this configuration property allows you to DROP the global tables used for multi-table bulk HQL operations when the
SessionFactoryor theEntityManagerFactoryis closed. </td> </tr>hibernate.hql.bulk_id_strategy.persistent.drop_tables</td>trueorfalse(default value) </td>This configuration property is used by the
PersistentTableBulkIdStrategy, that mimics temporary tables for databases which do not support temporary tables. It follows a pattern similar to the ANSI SQL definition of global temporary table using a "session id" column to segment rows from the various sessions.This configuration property allows you to DROP the tables used for multi-table bulk HQL operations when the
SessionFactoryor theEntityManagerFactoryis closed. </td> </tr>hibernate.hql.bulk_id_strategy.persistent.schema</td>Database schema name. By default, the
hibernate.default_schemais used. </td>This configuration property is used by the
PersistentTableBulkIdStrategy, that mimics temporary tables for databases which do not support temporary tables. It follows a pattern similar to the ANSI SQL definition of global temporary table using a "session id" column to segment rows from the various sessions.This configuration property defines the database schema used for storing the temporary tables used for bulk HQL operations. </td> </tr>
hibernate.hql.bulk_id_strategy.persistent.catalog</td>Database catalog name. By default, the
hibernate.default_catalogis used. </td>This configuration property is used by the
PersistentTableBulkIdStrategy, that mimics temporary tables for databases which do not support temporary tables. It follows a pattern similar to the ANSI SQL definition of global temporary table using a "session id" column to segment rows from the various sessions.This configuration property defines the database catalog used for storing the temporary tables used for bulk HQL operations. </td> </tr>
hibernate.legacy_limit_handler</td>trueorfalse(default value) </td>Setting which indicates whether or not to use
org.hibernate.dialect.pagination.LimitHandlerimplementations that sacrifices performance optimizations to allow legacy 4.x limit behavior.Legacy 4.x behavior favored performing pagination in-memory by avoiding the use of the offset value, which is overall poor performance. In 5.x, the limit handler behavior favors performance, thus, if the dialect doesn’t support offsets, an exception is thrown instead. </td> </tr> </tbody> </table> </div>