java - 如果我在 Hibernate 中使用 JPA,我的项目应该有哪些依赖项?

标签 java hibernate maven-2 jpa

我使用 JPA 和 Hibernate 作为其实现。我的项目需要有哪些maven2依赖项?

最佳答案

我相信您需要的唯一两件事是 hibernate 的实体管理器,然后是 SLF4J 日志记录包之一。其他一切都应该作为依赖项引入:

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>3.5.1-Final</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <!-- version 1.5.8 is the latest version that will work with the slf4j-api 
            that's currently bundled with hibernate-parent -->
        <version>1.5.8</version>
    </dependency>

关于java - 如果我在 Hibernate 中使用 JPA,我的项目应该有哪些依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3814761/

相关文章:

java - 在不使用数组时,是否有任何理由将循环的迭代从零而不是一初始化?

java - 在排序数组 X 中搜索第一个索引 i 使得 X[i] >= a

hibernate - 带有 JPA : default constructor hell 的 Kotlin

java - 将 CSS 和 JS 文件放在 Mavenized Java Web 应用程序中的最佳位置?

Java 未排序的 double ArrayList,如何获取最高值的索引?

java - 使用 GATE twitter 模型的斯坦福 POS 标记器速度很慢

hibernate - 使用 Hibernate+DataSource 将应用程序从 Tomcat 7 迁移到 Weblogic 12

hibernate - 服务方法回滚后从数据库读取对象

maven-2 - 如何使用 maven-gunit-plugin 生成 JUnit 源

dependencies - 如何排除 Maven 插件中的依赖关系?