I have all my Hibernate settings within a Spring file (i.e. applicationContext-hibernate.xml) instead of hibernate.cfg.xml, how can I refer to the Hibernate settings for the Hibernate Tools (e.g. Ant Task "hibernatetool" and Eclipse plugin) to work?
Code:
<!--
applicationContext-hibernate.xml
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<!-- jdbc information is defined in jdbc.properties -->
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>com/microsoft/model/User.hbm.xml</value>
<value>com/microsoft/model/Department.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.generate_statistics">false</prop>
<prop key="use_reflection_optimizer">false</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="userDAO" class="com.microsoft.dao.hibernate.UserDAOHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="departmentDAO" class="com.microsoft.dao.hibernate.DepartmentDAOHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</beans>
Thanks in advance.
Martin