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

2024-06-27

我使用 JPA 和 Hibernate 作为其实现。什么maven2依赖关系一need在我的项目中有吗?


我相信您唯一需要的两件事是 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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如果我在 Hibernate 中使用 JPA,我的项目应该有哪些依赖项? 的相关文章

随机推荐