mappingResources用于指定少量的hibernate配置文件
Xml代码
<property name="mappingResources">
<list>
<value>WEB-INF/conf/hibernate/cat.hbm.</value>
<value>WEB-INF/conf/hibernate/dog.hbm.</value>
......
</list>
</property>
就这样一个一个的写呗,当你觉得麻烦的时候,找mappingDirectoryLocations来就行了
Xml代码
<property name="mappingDirectoryLocations">
<list>
<value>WEB-INF/conf/hibernate</value>
</list>
</property>
<property name="annotatedClasses">
<list><value>com.systop.common.core.dao.testmodel.TestDept</value></list>
</property>
当有多个的时候,可以用扫描包的方法
<property name="packagesToScan">
<list><value>com.systop.common.core.dao.testmodel</value></list>
</property>