在Spring中配置多个*.hbm.xml文件
在Spring中配置多个*.hbm.xml文件
<beans>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
<prop key="hibernate.autoReconnect">true</prop>
</props>
</property>
<property name="mappingLocations">
<value>/WEB-INF/template/db/**/*.hbm.xml</value>
</property>
</bean>
</beans>
template文件夹下面的所有数据库映射文件会被加载。