用户登录
用户注册

分享至

hibernate 4 mapping

  • 作者: 大驴的
  • 来源: 51数据库
  • 2020-10-18

你看下我的配置 尤其是最后几行就明白了 

<bean id="sessionFactory"

class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

<property name="dataSource" ref="dataSource" />


<property name="hibernateProperties">

<props>

<prop key="hibernate.dialect">

org.hibernate.dialect.Oracle10gDialect

</prop>

<prop key="hibernate.show_sql">true</prop>

<!-- 配置二级缓存 -->  

<prop key="hibernate.cache.use_second_level_cache">true</prop>

<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>  

<prop key="hibernate.cache.use_query_cache">true</prop>

</props>

</property>

<!-- 读取 com.eshore.order 下的所有的  hbm.xml 文件 -->  

<property name="mappingLocations"

value="classpath*:com/eshore/order/**/*.hbm.xml" />

</bean>


软件
前端设计
程序设计
Java相关