zoukankan      html  css  js  c++  java
  • spring 扫描hibernate的映射文件

    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>
  • 相关阅读:
    密码学与安全技术
    分布式系统核心问题
    虚拟机性能监控与故障处理工具
    垃圾收集器与内存分配策略
    Channel
    Buffer
    Reactor
    I/O简介
    HashMap
    装饰者模式
  • 原文地址:https://www.cnblogs.com/fengyexjtu/p/5049957.html
Copyright © 2011-2022 走看看