栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

使用Hibernate,休眠注释和ehcache的Maven依赖项是什么?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用Hibernate,休眠注释和ehcache的Maven依赖项是什么?

如果您真的是说hibernate-annotations(而不是hibernate-
entitymanager)和ehcache的最终版本,那么您将需要以下内容:

<project>  ...  <dependencies>    <dependency>      <groupId>org.hibernate</groupId>      <artifactId>hibernate-core</artifactId>      <version>3.6.0.Final</version>    </dependency>    <dependency>       <groupId>net.sf.ehcache</groupId>       <artifactId>ehcache-core</artifactId>       <version>2.2.0</version>   </dependency>   ...  </dependencies>  <repositories>    <repository>      <id>repository.jboss.org-public</id>      <name>JBoss repository</name>      <url>https://repository.jboss.org/nexus/content/groups/public</url>    </repository>  </repositories>  ...</project>

从Hibernate 3.6开始,已删除了对JDK 1.4的支持,并将Hibernate Annotations合并回了Core。

我的意思是说Hibernate EntityManager,然后在上面的代码段中替换

hibernate-core
hibernate-entitymanager

关于EHCache,

ehcache-core
应提供您所需的一切(包括“新的” Hibernate 3.3 /
3.5及其SPI缓存SPI的实现
CacheRegionFactory
)。因此,如记录所示:

将Ehcache设置为hibernate二级缓存

Hibernate 3.3及更高版本

注意海纳特3.2用户

确保记下属性名称和值的更改。

采用:

<property name="hibernate.cache.region.factory_class">          net.sf.ehcache.hibernate.EhCacheRegionFactory</property>

例如创建,或

<property name="hibernate.cache.region.factory_class">

net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/468959.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号