mappingResources用于指定少量的hibernate配置文件像这样

<property name="mappingResources"> 
  <list> 
    <value>WEB-INF/conf/hibernate/cat.hbm.</value>  
    <value>WEB-INF/conf/hibernate/dog.hbm.</value> .
    <!--.....  --> 
  </list> 
</property>

 


mappingDirectoryLocations:批量导入

<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>

 

posted on 2015-12-16 00:37  fengyexjtu  阅读(363)  评论(0编辑  收藏  举报