Koshan Samarasinghe
Koshan Samarasinghe

Reputation: 67

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. 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

Answers (1)

hovanessyan
hovanessyan

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

Related Questions