java - Hibernate 问题中不推荐使用注释

标签 java hibernate jpa annotations slf4j

我正在尝试编写一些 hibernate 示例,并且我发现了这个:

AnnotationConfiguration config = new AnnotationConfiguration();

Eclipse 说:已弃用

此外,当我运行应用程序时,我得到以下信息:

SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.

SLF4J: Your binding is version 1.5.5 or earlier.

SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x

我使用了这两个 Hibernate 包:

hibernate-annotations-3.4.0.GA & hibernate-distribution-3.6.5.Final-dist

如何解决这个问题。

谢谢

最佳答案

对于您的第一个问题,请参阅帖子 Hibernate - AnnotationConfiguration deprecated

我猜 SLF4J 与此无关,尝试调查您的项目中包含哪些库,并放置正确的 SLF4J 版本。考虑this tutorial欲了解更多信息,例如

致以诚挚的问候。

关于java - Hibernate 问题中不推荐使用注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6403891/

相关文章:

mysql - Hibernate允许外键成为众多类之一吗?

hibernate - 如何查询以二进制形式存储在数据库中的 UUID(JPA/Hibernate/MySQL)

java - QueryDSL 多参数搜索,同时在值为 null 时构建查询跳过谓词

java - 使用 Spring Boot JPA 和 db H2 通过 Postman 发布图像

java - Spring @Transactional 多线程

java - 无需访问源代码即可从对象获取/设置值

java - 仅当在一定时间内检测到信标时才显示通知

java - SEAM/hibernate : I can't get changes from database during a Conversation

mysql - 什么 Hibernate 3.5.1 方言最适合访问 MySQL 5.1

java - Swig:如何将 "FILE"类型从 C++ 传递到 Java