ITeye博客

在Spring中配置多个*.hbm.xml文件

Jseeker · 2010-12-09 23:37 · 企业架构 · Spring · SQL · XML · Hibernate · Bean · Markdown

在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文件夹下面的所有数据库映射文件会被加载。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。