<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "classpath://org/hibernate/hibernate-configuration-3.0.dtd">
<!-- DO NOT CHANGE THE ABOVE DTD LOCATION. IT MUST BE FETCHED FROM THE CLASSPATH.
See https://jira.slac.stanford.edu/browse/LSSTCCS-699 for more details -->
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQL55Dialect</property>
        <property name="hibernate.show_sql">false</property>
        <property name="hibernate.format_sql">true</property>


        <property name="hibernate.hbm2ddl.auto">validate</property>
        <property name="hibernate.c3p0.acquire_increment">1</property>
        <property name="hibernate.c3p0.idle_test_period">100</property> <!-- seconds -->
        <property name="hibernate.c3p0.max_size">100</property>
        <property name="hibernate.c3p0.max_statements">0</property>
        <property name="hibernate.c3p0.min_size">10</property>
        <property name="hibernate.c3p0.timeout">100</property> <!-- seconds -->
		
        <property name="current_session_context_class">thread</property>
		
        <property name="hibernate.connection.autocommit">false</property>

        <property name="hibernate.jdbc.batch_size">50</property>
        <property name="hibernate.jdbc.fetch_size">5</property>
        <property name="hibernate.jdbc.batch_versioned_data">true</property>
		
        <property name="hibernate.order_inserts">true</property>
        <property name="hibernate.order_updates">true</property>
	
        <!-- cache configuration -->	
        <property name="hibernate.cache.use_query_cache">true</property>
        <property name="hibernate.cache.use_second_level_cache">true</property>
        <property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</property>
        <property name="net.sf.ehcache.configurationResourceName">cache/ehcache.xml</property>
        <property name="hibernate.generate_statistics">true</property>
        <property name = "hibernate.cache.use_reference_entries">true</property>
        
        <!-- naming strategy-->
        <!-- property name="hibernate.implicit_naming_strategy">org.lsst.ccs.localdb.statusdb.model.CCSNamingStrategy</property-->
        
        <!-- to take account of package-info.java -->
        <mapping package="org.lsst.ccs.localdb.statusdb.model"/>
        
        <!-- mapping files -->
        <mapping class="org.lsst.ccs.localdb.statusdb.model.DataDesc" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.RawData" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.RawDataId" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.StatDesc" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.StatTimeInterval" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.StatData" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.MetaDataData" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.DataGroup" />
        
        <mapping class="org.lsst.ccs.localdb.statusdb.model.AgentDesc" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.AlertDesc" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.ClearedAlertData" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.RaisedAlertData" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.InnerStateDesc"/>
        <mapping class="org.lsst.ccs.localdb.statusdb.model.AgentState" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.StateBundleDesc" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.StateChangeNotificationData" />

        
        <!-- mapping for configuration entities -->
        <mapping class="org.lsst.ccs.localdb.configdb.model.ConfigurationParameter" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.Description" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.BaseDescription" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.ConfigurationParameterValue" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.Configuration" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.ConfigurationRun" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.GlobalConfiguration" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.ConfigurationInfoData" />
    </session-factory>
</hibernate-configuration>
