Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如果我';我在Hibernate中使用JPA?_Java_Hibernate_Maven 2_Jpa - Fatal编程技术网

Java 如果我';我在Hibernate中使用JPA?

Java 如果我';我在Hibernate中使用JPA?,java,hibernate,maven-2,jpa,Java,Hibernate,Maven 2,Jpa,我使用JPA和Hibernate作为它的实现。在我的项目中,我需要什么maven2依赖关系?我相信您只需要hibernate的entitymanager和一个SLF4J日志包。其他所有内容都应作为依赖项拉入: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId>

我使用JPA和Hibernate作为它的实现。在我的项目中,我需要什么
maven2
依赖关系?

我相信您只需要hibernate的entitymanager和一个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>

org.hibernate
休眠实体管理器
3.5.1-最终版本
org.slf4j
slf4j-jdk14
1.5.8

以下是我正在使用的。您可能想保留或不想保留免责条款;它们对我来说很有意义,因为JTA和JPA已经包含在我在别处提供的完整JavaEEAPI中。如果您不使用Commons日志记录,您可能需要选择不同的slf4j实现

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.5.3-Final</version>
        <exclusions>
            <exclusion>
                <artifactId>jta</artifactId>
                <groupId>javax.transaction</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>3.5.3-Final</version>
        <exclusions>
            <exclusion>
                <artifactId>hibernate-jpa-2.0-api</artifactId>
                <groupId>org.hibernate.javax.persistence</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <!-- match version to the slf4j-api that's required by Hibernate -->
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jcl</artifactId>
        <version>1.5.8</version>
    </dependency>

org.hibernate
冬眠核心
3.5.3-最终版本
jta
javax.transaction
org.hibernate
休眠实体管理器
3.5.3-最终版本
hibernate-jpa-2.0-api
org.hibernate.javax.persistence
org.slf4j
slf4j jcl
1.5.8