<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<!-- DATASOURCE HSQLDB -->
	<bean id="issnDataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
		<!--            <property name="url" value="jdbc:hsqldb:mem:memdb" />-->
		<property name="url"
			value="jdbc:hsqldb:file:/tmp/issndb/issn;shutdown=true" />
		<property name="username" value="sa" />
		<property name="password" value="" />
	</bean>

	<!-- Hibernate SessionFactory -->
	<bean id="issnSessionFactory"
		class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
		p:dataSource-ref="issnDataSource">
		<property name="annotatedClasses">
			<list>
				<value>eu.dnetlib.enabling.is.sn.resourcestate.ResourceStateSubscription</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect
				</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.hbm2ddl.auto">create</prop>
			</props>
		</property>
	</bean>
	
	<bean id="issnTransactionManager"
		class="org.springframework.orm.hibernate4.HibernateTransactionManager"
		p:sessionFactory-ref="issnSessionFactory" />

	<bean id="hibernateResourceStateSubscriptionDAO"
		class="eu.dnetlib.enabling.is.sn.resourcestate.hib.HibernateResourceStateSubscriptionDAOImpl"
		p:sessionFactory-ref="issnSessionFactory" />

</beans>
