Reputation: 67
I'm new to SpringBoot development and I want to add Hibernate ORM framework to my SpringBoot project. 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.
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?
Upvotes: 2
Views: 3930
Reputation: 31433
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.
The minimums are the hibernate-core
package and spring-orm
.
This tutorial describes how to do it step by step.
Upvotes: 3