bunti/src/main/resources/META-INF/spring/hibernate-beans.xml

45 lines
1.6 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"
xmlns:jdbc="http://www.springframework.org/schema/jdbc">
<jdbc:embedded-database id="dataSource" type="H2">
<jdbc:script location="classpath:init.sql" />
</jdbc:embedded-database>
<bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="packagesToScan" value="de.ctdo.bunti.model"/>
<!--<property name="mappingResources">-->
<!--<list>-->
<!--<value>/bunti.hbm.xml</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>
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="hibernateSessionFactory" />
</bean>
<bean id="roomsDAO" class="de.ctdo.bunti.dao.RoomsDAOImpl">
<property name="sessionFactory" ref="hibernateSessionFactory" />
</bean>
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
</beans>