<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not remove this line. File tag: hibernate_conf-APV-7.4.6. -->

<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

  <session-factory>

    <!-- Sample database connection settings for HSQL (suitable for testing) -->
    <!-- HSQL jar to be included under lib/mpn/hibernate or specified in the mpnpath variable in the launch script -->
    <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
    <property name="connection.url">jdbc:hsqldb:hsql://localhost</property>
    <property name="connection.username">sa</property>
    <property name="connection.password"></property>
    <property name="dialect">org.hibernate.dialect.HSQLDialect</property>

    <!-- Sample database connection settings for MySQL -->
    <!-- JDBC jar to be included under lib/mpn/hibernate or specified in the mpnpath variable in the launch script -->
    <!-- WARNING! MySQL introduces default limits on index sizes. This may affect the INDEX_SUBSCRIPTION_KEY index.
         In this case, some of the columns that are included in the index may have to be reduced.
         This will constrain the length of the names that the application will be able to use.
         For instance, if the application doesn't leverage triggers, the TRIGGER_EXP field can be reduced safely. -->
    <!--
    <property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
    <property name="connection.url">jdbc:mysql://192.168.1.100:3306/lsmpn</property>
    <property name="connection.username">root</property>
    <property name="connection.password"></property>
    <property name="dialect">org.hibernate.dialect.MySQL8Dialect</property>
    -->
    <!--
        Notes for MySQL:
        With the configuration shown, there is a limit to the size of indexes of 3072 bytes.
        This may affect the INDEX_SUBSCRIPTION_KEY index defined in Subscription.hbm.xml.
        In this case, you should reduce the size of some of the involved columns; note that any character weights for 4 bytes.
    -->

    <!-- Sample database connection settings for MS SQL Server -->
    <!-- SQL Server jar to be included under lib/mpn/hibernate or specified in the mpnpath variable in the launch script -->
    <!--
    <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
    <property name="connection.url">jdbc:sqlserver://192.168.1.100:1433;databaseName=lsmpn;encrypt=False</property>
    <property name="connection.username">guest</property>
    <property name="connection.password"></property>
    <property name="dialect">org.hibernate.dialect.SQLServer2008Dialect</property>
    -->
    <!--
        Notes for SQL Server:
        Due to the default page-level locking policy adopted by SQL Server, intense activity may be deadlock-prone.
        Better performances can be achieved by configuring the DB to use SNAPSHOT isolation level.
        This also requires configuration of "hikari.transactionIsolation" as TRANSACTION_SQL_SERVER_SNAPSHOT_ISOLATION_LEVEL.
    -->

    <!-- Sample database connection settings for Oracle 11g -->
    <!-- JDBC jar to be included under lib/mpn/hibernate or specified in the mpnpath variable in the launch script -->
    <!--
    <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="connection.url">jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORCL) (SRVR = DEDICATED)))</property>
    <property name="connection.username">system</property>
    <property name="connection.password"></property>
    <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
    -->

    <!-- HikariCP database connection pool configuration -->
    <property name="hikari.connectionTimeout">5000</property>
    <!-- <property name="hikari.maximumPoolSize">150</property> -->
    <!-- <property name="hikari.maxLifetime">500000</property> -->

    <!-- see other configuration settings for HikariCP -->
    <!-- <property name="hikari.transactionIsolation">TRANSACTION_READ_COMMITTED</property> -->

    <!-- Enable Hibernate's automatic session context management -->
    <property name="current_session_context_class">thread</property>

    <!-- Disable the second-level cache  -->
    <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>

    <!-- Automatically create/update the database schema on startup -->
    <property name="hbm2ddl.auto">update</property>

    <!-- Debugging: echo all executed SQL to console -->
    <property name="show_sql">false</property>

    <!-- Mapping files: these paths are relative to the current directory.
         If the Server has been started with its scripts, the samples paths
         hereunder are correct. But if it has been start with cron or another
         scheduler they may need to be fixed. -->
    <mapping file="../../conf/mpn/Module.hbm.xml"/>
    <mapping file="../../conf/mpn/Command.hbm.xml"/>
    <mapping file="../../conf/mpn/Device.hbm.xml"/>
    <mapping file="../../conf/mpn/Subscription.hbm.xml"/>
    <mapping file="../../conf/mpn/SubscriptionItem.hbm.xml"/>

  </session-factory>

</hibernate-configuration>
