<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

	<session-factory>

		<!-- Database connection settings -->
		<!-- <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
			<property name="connection.url">jdbc:hsqldb:hsql://localhost/TestDB</property> -->

		<property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
		<property name="connection.url">jdbc:derby:target/derby/hibernateDB;create=true</property>
		<property name="connection.username">user1</property>
		<property name="connection.password">user1</property>

		<!-- JDBC connection pool (use the built-in) -->
		<property name="connection.pool_size">1</property>

		<!-- SQL dialect -->
		<property name="dialect">
			org.hibernate.dialect.DerbyDialect
		</property>

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

		<property name="cache.use_query_cache">true</property>
		<property name="cache.use_second_level_cache">true</property>
		<property name="cache.use_structured_entries">true</property>
		<property name="cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</property>
        <property name="net.sf.ehcache.configurationResourceName">/hibernate-config/ehcache.xml</property>
		<!-- Echo all executed SQL to stdout -->
		<property name="show_sql">true</property>

		<mapping resource="hibernate-config/domain/Event.hbm.xml" />
		<mapping resource="hibernate-config/domain/Person.hbm.xml" />
		<mapping resource="hibernate-config/domain/PhoneNumber.hbm.xml" />
		<mapping resource="hibernate-config/domain/Account.hbm.xml" />
		<mapping resource="hibernate-config/domain/HolidayCalendar.hbm.xml" />

		<mapping resource="hibernate-config/domain/Item.hbm.xml" />

	</session-factory>

</hibernate-configuration>
