<?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.MySQLInnoDBDialect</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">true</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>
        
        <!-- 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.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.PlotData" />
        
        <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.BaseState" />
        <mapping class="org.lsst.ccs.localdb.statusdb.model.StateChangeNotificationData" />
        
        <!-- mapping for configuration entities -->
        <mapping class="org.lsst.ccs.localdb.configdb.model.AParameterDescription" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.GhostParameterDescription" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.ASubsystemDescription" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.GhostSubsystemDescription" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.AParameterConfiguration" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.PastParameterConfiguration" />       
        <mapping class="org.lsst.ccs.localdb.configdb.model.AConfigProfile" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.PastConfigProfile" />
        <mapping class="org.lsst.ccs.localdb.configdb.model.RunHistory" />
    </session-factory>
</hibernate-configuration>
