简体   繁体   English

带有纯Hibernate ORM的SpringBoot配置,无需JPA

[英]SpringBoot configuration with pure Hibernate ORM without JPA

I'm new to SpringBoot development and I want to add Hibernate ORM framework to my SpringBoot project. 我是SpringBoot开发的新手,我想在我的SpringBoot项目中添加Hibernate ORM框架 I know 我知道

     <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

this dependency gives that capability but it's not supporting for every Hibernate features in pure Hibernate framework. 这种依赖关系提供了该功能,但它不支持纯Hibernate框架中的所有Hibernate功能。

Example: 例:

session.createNativeQuery(query).addEntity(LectureSchedule.class).list();

is there any way to configure Hibernate framework for SpringBoot applications not via JPA dependency and autowire SessionFactory so I can perform basic hibernate coding after that without using JPA methods? 没有通过JPA依赖关系和自动装配SessionFactory来为SpringBoot应用程序配置Hibernate框架的方法,因此我可以在不使用JPA方法的情况下执行基本的Hibernate编码?

If you don't want to use the spring starter pom file, you can add the hibernate dependencies one by one - depending on your needs. 如果您不想使用spring starter pom文件,则可以根据需要逐个添加休眠依赖项。

The minimums are the hibernate-core package and spring-orm . 最低限度是hibernate-core包和spring-orm

This tutorial describes how to do it step by step. 教程逐步介绍了操作方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM