Spring 配置批量加载Hibernate文件

<bean id="sessionFactory_DB2"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource_DB2" /> 
<property name="packagesToScan"><!-- 配置在类中配置HIBERNATE信息的类批量加载 -->
<list>
<value>cn.net.withub/**/model</value>
</list>
</property>
<property name="mappingLocations"><!-- 配置传统的HRM文件批量加载 -->
<list>
<value>
classpath*:/cn/net/withub/other/orm/*.hbm.xml
</value>
</list>
</property>

你可能感兴趣的:(Hibernate)