在過去使用 Spring 整合 Hibernate 的時候,都是用這樣的配置方式。
<bean id="sessionFactory" lazy-init="true"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>resources/icustomer/Contact.hbm.xml</value>
<value>resources/icustomer/Customer.hbm.xml</value>
</list>
</property>
.
</bean>
每當需要加入一個新的 VO 時,我需要過來修改配置文件,來引入對新的 VO 的支持。現在我使用的時候,是這么配的:
<bean id="sessionFactory" lazy-init="true"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingLocations">
<list>
<value>classpath:resources/**/*.hbm.xml</value>
</list>
</property>
.
</bean>
做項目開發的時候,就再也沒有改過配置。
posted on 2007-08-17 13:58
steady 閱讀(1932)
評論(5) 編輯 收藏 所屬分類:
技術隨筆