<?xml version='1.0' encoding='utf-8' ?>

<!--
  ~ Hibernate, Relational Persistence for Idiomatic Java
  ~
  ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
  ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<appendix xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink">

    <title>Configuration properties</title>

    <section xml:id="config-strategy">
        <title>Strategy configurations</title>
        <para>
            Many configuration settings define pluggable strategies that Hibernate uses for various purposes.
            The configuration of many of these strategy type settings accept definition in various forms.  The
            documentation of such configuration settings refer here.  The types of forms available in such cases
            include:
        </para>
        <variablelist>
            <varlistentry>
                <term>short name (if defined)</term>
                <listitem>
                    <para>
                        Certain built-in strategy implementations have a corresponding short name.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>strategy instance</term>
                <listitem>
                    <para>
                        An instance of the strategy implementation to use can be specified
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>strategy Class reference</term>
                <listitem>
                    <para>
                        A <classname>java.lang.Class</classname> reference of the strategy implementation to use can
                        be specified
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>strategy Class name</term>
                <listitem>
                    <para>
                        The class name (<classname>java.lang.String</classname>) of the strategy implementation to
                        use can be specified
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </section>


  <section>
    <title>General Configuration</title>
    <informaltable>
      <tgroup cols="3">
        <colspec colwidth="100px" />
        <colspec colwidth="120px" />
        <colspec colwidth="250px" />
        <tbody>
          <row>
            <entry>hibernate.dialect</entry>
            <entry>A fully-qualified classname</entry>
            <entry>
              <para>
                The classname of a Hibernate <classname>org.hibernate.dialect.Dialect</classname> from which Hibernate
                can generate SQL optimized for a particular relational database.
              </para>
              <para>
                In most cases Hibernate can choose the correct <classname>org.hibernate.dialect.Dialect</classname>
                implementation based on the JDBC metadata returned by the JDBC driver.
              </para>
            </entry>
          </row>
          <row>
            <entry>hibernate.show_sql</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Write all SQL statements to the console. This is an alternative to setting the log category
            <property>org.hibernate.SQL</property> to debug.</entry>
          </row>
          <row>
            <entry>hibernate.format_sql</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Pretty-print the SQL in the log and console.</entry>
          </row>
          <row>
            <entry>hibernate.default_schema</entry>
            <entry>A schema name</entry>
            <entry>Qualify unqualified table names with the given schema or tablespace in generated SQL.</entry>
          </row>
          <row>
            <entry>hibernate.default_catalog</entry>
            <entry>A catalog name</entry>
            <entry>Qualifies unqualified table names with the given catalog in generated SQL.</entry>
          </row>
          <row>
            <entry>hibernate.session_factory_name</entry>
            <entry>A JNDI name</entry>
            <entry>The <classname>org.hibernate.SessionFactory</classname> is automatically bound to this name in JNDI
            after it is created.</entry>
          </row>
          <row>
            <entry>hibernate.max_fetch_depth</entry>
            <entry>A value between <literal>0</literal> and <literal>3</literal></entry>
            <entry>Sets a maximum depth for the outer join fetch tree for single-ended associations. A single-ended
            assocation is a one-to-one or many-to-one assocation. A value of <literal>0</literal> disables default outer
            join fetching.</entry>
          </row>
          <row>
            <entry>hibernate.default_batch_fetch_size</entry>
            <entry><para><literal>4</literal>,<literal>8</literal>, or <literal>16</literal></para></entry>
            <entry>Default size for Hibernate batch fetching of associations.</entry>
          </row>
          <row>
            <entry>hibernate.default_entity_mode</entry>
            <entry><para><literal>dynamic-map</literal> or <literal>pojo</literal></para></entry>
            <entry>Default mode for entity representation for all sessions opened from this
            <classname>SessionFactory</classname>, defaults to <literal>pojo</literal>.</entry>
          </row>
          <row>
            <entry>hibernate.order_updates</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Forces Hibernate to order SQL updates by the primary key value of the items being updated. This
            reduces the likelihood of transaction deadlocks in highly-concurrent systems.</entry>
          </row>
          <row>
            <entry>hibernate.order_by.default_null_ordering</entry>
            <entry><para><literal>none</literal>, <literal>first</literal> or <literal>last</literal></para></entry>
            <entry>Defines precedence of null values in <literal>ORDER BY</literal> clause. Defaults to
            <literal>none</literal> which varies between RDBMS implementation.</entry>
          </row>
          <row>
            <entry>hibernate.generate_statistics</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Causes Hibernate to collect statistics for performance tuning.</entry>
          </row>
          <row>
            <entry>hibernate.use_identifier_rollback</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>If true, generated identifier properties are reset to default values when objects are
            deleted.</entry>
          </row>
          <row>
            <entry>hibernate.use_sql_comments</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>If true, Hibernate generates comments inside the SQL, for easier debugging.</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </section>
  <section>
    <title>Database configuration</title>
    <table>
      <title>JDBC properties</title>
      <tgroup cols="3">
        <thead>
          <row>
            <entry>Property</entry>
            <entry>Example</entry>
            <entry>Purpose</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>hibernate.jdbc.fetch_size</entry>
            <entry><literal>0</literal> or an integer</entry>
            <entry>A non-zero value determines the JDBC fetch size, by calling
            <methodname>Statement.setFetchSize()</methodname>.</entry>
          </row>
          <row>
            <entry>hibernate.jdbc.batch_size</entry>
            <entry><para>A value between <literal>5</literal> and <literal>30</literal></para></entry>
            <entry>A non-zero value causes Hibernate to use JDBC2 batch updates.</entry>
          </row>
          <row>
            <entry>hibernate.jdbc.batch_versioned_data</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry><para>Set this property to <literal>true</literal> if your JDBC driver returns correct row counts
            from <methodname>executeBatch()</methodname>. This option is usually safe, but is disabled by default. If
            enabled, Hibernate uses batched DML for automatically versioned data.</para></entry>
          </row>
          <row>
            <entry>hibernate.jdbc.factory_class</entry>
            <entry>The fully-qualified class name of the factory</entry>
            <entry><para>Select a custom <classname>org.hibernate.jdbc.Batcher</classname>. Irrelevant for most
            applications.</para></entry>
          </row>
          <row>
            <entry>hibernate.jdbc.use_scrollable_resultset</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Enables Hibernate to use JDBC2 scrollable resultsets. This property is only relevant for
            user-supplied JDBC connections. Otherwise, Hibernate uses connection metadata.</entry>
          </row>
          <row>
            <entry>hibernate.jdbc.use_streams_for_binary</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry><para>Use streams when writing or reading <type>binary</type> or <type>serializable</type> types to
            or from JDBC. This is a system-level property.</para></entry>
          </row>
          <row>
            <entry>hibernate.jdbc.use_get_generated_keys</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry><para>Allows Hibernate to use JDBC3 <classname>PreparedStatement.getGeneratedKeys()</classname> to
            retrieve natively-generated keys after insert. You need the JDBC3+ driver and JRE1.4+. Disable this property
            if your driver has problems with the Hibernate identifier generators. By default, it tries to detect the
            driver capabilities from connection metadata.</para></entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <table>
      <title>Cache Properties</title>
      <tgroup cols="3">
        <colspec colwidth="100px" />
        <colspec colwidth="100px" />
        <colspec colwidth="240px" />
        <thead>
          <row>
            <entry>Property</entry>
            <entry>Example</entry>
            <entry>Purpose</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>hibernate.cache.provider_class</entry>
            <entry>Fully-qualified classname</entry>
            <entry>The classname of a custom CacheProvider.</entry>
          </row>
          <row>
            <entry>hibernate.cache.use_minimal_puts</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This
            is most useful for clustered caches and is enabled by default for clustered cache implementations.</entry>
          </row>
          <row>
            <entry>hibernate.cache.use_query_cache</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Enables the query cache. You still need to set individual queries to be cachable.</entry>
          </row>
          <row>
            <entry>hibernate.cache.use_second_level_cache</entry> <entry><para><literal>true</literal> or
            <literal>false</literal></para></entry> <entry>Completely disable the second level cache, which is enabled
            by default for classes which specify a &lt;cache&gt; mapping.</entry>
          </row>
          <row>
            <entry>hibernate.cache.query_cache_factory</entry>
            <entry>Fully-qualified classname</entry>
            <entry>A custom <interfacename>QueryCache</interfacename> interface. The default is the built-in
            <interfacename>StandardQueryCache</interfacename>.</entry>
          </row>
          <row>
            <entry>hibernate.cache.region_prefix</entry>
            <entry>A string</entry>
            <entry>A prefix for second-level cache region names.</entry>
          </row>
          <row>
            <entry>hibernate.cache.use_structured_entries</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Forces Hibernate to store data in the second-level cache in a more human-readable format.</entry>
          </row>
          <row>
            <entry>hibernate.cache.auto_evict_collection_cache</entry>
            <entry><para><literal>true</literal> or <literal>false</literal> (default: false)</para></entry>
            <entry>Enables the automatic eviction of a bi-directional association's collection cache when an element 
            in the ManyToOne collection is added/updated/removed without properly managing the change on the OneToMany 
            side.</entry>
          </row>
            <row>
                <entry>hibernate.cache.use_reference_entries</entry>
                <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
                <entry>Optimizes second-level cache operation to store immutable entities  (aka "reference")  which do
                    not have associations into cache directly, this case, lots of disasseble and deep copy operations
                can be avoid.
                    Default value of this property is <literal>false</literal>.
                </entry>
            </row>
        </tbody>
      </tgroup>
    </table>
    <table>
      <title>Transactions properties</title>
      <tgroup cols="3">
        <colspec colwidth="100px" />
        <colspec colwidth="100px" />
        <colspec colwidth="240px" />

        <thead>
          <row>
            <entry>Property</entry>
            <entry>Example</entry>
            <entry>Purpose</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>hibernate.transaction.factory_class</entry>
            <entry>
                <para><property>jdbc</property> or <property></property></para>
            </entry>
            <entry>
                <para>
                    Names the <interfacename>org.hibernate.engine.transaction.spi.TransactionFactory</interfacename>
                    strategy implementation to use.  See <xref linkend="config-strategy"/> and
                    <xref linkend="services-TransactionFactory"/>
                </para>
            </entry>
          </row>
          <row>
            <entry>jta.UserTransaction</entry>
            <entry>A JNDI name</entry>
            <entry><para>The <classname>JTATransactionFactory</classname> needs a JNDI name to obtain the JTA
            UserTransaction from the application server.</para></entry>
          </row>
          <row>
            <entry>hibernate.transaction.manager_lookup_class</entry>
            <entry>A fully-qualified classname</entry>
            <entry><para>The classname of a <classname>TransactionManagerLookup</classname>, which is used in
            conjunction with JVM-level or the hilo generator in a JTA environment.</para></entry>
          </row>
          <row>
            <entry>hibernate.transaction.flush_before_completion</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Causes the session be flushed during the <phrase>before completion</phrase> phase of the
            transaction. If possible, use built-in and automatic session context management instead.</entry>
          </row>
          <row>
            <entry>hibernate.transaction.auto_close_session</entry>
            <entry><para><literal>true</literal> or <literal>false</literal></para></entry>
            <entry>Causes the session to be closed during the <phrase>after completion</phrase> phase of the
            transaction. If possible, use built-in and automatic session context management instead.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <note>
      <para>
        Each of the properties in the following table are prefixed by <literal>hibernate.</literal>. It has been removed
        in the table to conserve space.
      </para>
    </note>
    <table>
      <title>Miscellaneous properties</title>
      <tgroup cols="3">
        <thead>
          <row>
            <entry>Property</entry>
            <entry>Example</entry>
            <entry>Purpose</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>current_session_context_class</entry>
            <entry><para>One of <literal>jta</literal>, <literal>thread</literal>, <literal>managed</literal>, or
            <literal>custom.Class</literal></para></entry>
            <entry><para>Supply a custom strategy for the scoping of the <classname>Current</classname>
            Session.</para></entry>
          </row>
          <row>
            <entry>factory_class</entry>
            <entry><para><literal>org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory</literal> or
            <literal>org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory</literal></para></entry>
            <entry>Chooses the HQL parser implementation.</entry>
          </row>
          <row>
            <entry>query.substitutions</entry>
            <entry><para><literal>hqlLiteral=SQL_LITERAL</literal> or <literal>hqlFunction=SQLFUNC</literal>
            </para></entry>
            <entry>Map from tokens in Hibernate queries to SQL tokens, such as function or literal names.</entry>
          </row>
          <row>
            <entry>hbm2ddl.auto</entry>
            <entry><para><literal>validate</literal>, <literal>update</literal>, <literal>create</literal>,
            <literal>create-drop</literal></para></entry>
            <entry>Validates or exports schema DDL to the database when the <classname>SessionFactory</classname> is
            created. With <command>create-drop</command>, the database schema is dropped when the
            <classname>SessionFactory</classname> is closed explicitly.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </section>
  <section>
    <title>Connection pool properties</title>
    <itemizedlist>
      <title>c3p0 connection pool properties</title>
      <listitem><para>hibernate.c3p0.min_size</para></listitem>
      <listitem><para>hibernate.c3p0.max_size</para></listitem>
      <listitem><para>hibernate.c3p0.timeout</para></listitem>
      <listitem><para>hibernate.c3p0.max_statements</para></listitem>
    </itemizedlist>
    <table>
      <title>Proxool connection pool properties</title>
      <tgroup cols="2">
        <colspec colwidth="100px" />
        <colspec colwidth="340px" />
        <thead>
          <row>
            <entry>Property</entry>
            <entry>Description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>hibernate.proxool.xml</entry>
            <entry>Configure Proxool provider using an XML file (.xml is appended automatically)</entry>
          </row>
          <row>
            <entry>hibernate.proxool.properties</entry>
            <entry>Configure the Proxool provider using a properties file (.properties is appended
            automatically)</entry>
          </row>
          <row>
            <entry>hibernate.proxool.existing_pool</entry>
            <entry>Whether to configure the Proxool provider from an existing pool</entry>
          </row>
          <row>
            <entry>hibernate.proxool.pool_alias</entry>
            <entry>Proxool pool alias to use. Required.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <note>
      <para>
        For information on specific configuration of Proxool, refer to the Proxool documentation available from
          <link xlink:href="http://proxool.sourceforge.net/" />.
      </para>
    </note>
  </section>
</appendix>
