导入org.springframework.orm.hibernate3.support.HibernateDaoSupport无法解析

Mar*_*ohn 2 java spring hibernate maven

您好,我正在尝试使用 REST 在 Spring 中开发一个示例项目。我正在使用 Spring 4.0.0.release。为了实现休眠操作,我导入了 import org.springframework.orm.hibernate3.support.HibernateDaoSupport但错误显示The import org.springframework.orm.hibernate3.support.HibernateDaoSupport cannot be resolved。我的 pom.xml 包括:

<!-- Spring -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${org.springframework-version}</version>
        <exclusions>
            <!-- Exclude Commons Logging in favor of SLF4j -->
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${org.springframework-version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>4.0.0.RELEASE</version>
    </dependency>

    <!-- HIbernate  -->

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>5.0.0.Final</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

链接[ http://docs.spring.io/autorepo/docs/spring/4.0.0.M3/javadoc-api/index.html?org/springframework/orm/hibernate3/support/HibernateDaoSupport.html][1]说 Spring 包含以下类:org.springframework.orm.hibernate3.support.HibernateDaoSupport

请帮助我克服这个问题。任何帮助将不胜感激。

Epi*_*rce 5

根据 Maven 存储库http://mvnrepository.com/artifact/org.springframework/spring-orm/4.0.0.RELEASE

您应该使用以下内容:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>4.0.0.RELEASE</version>
</dependency>


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

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.2.2.Final</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

如果这不起作用,请尝试3.6.9.Final休眠版本。