I am new to Hibernate and Spring boot. I understand that hibernate is ORM tool so that you can map objects to database and just use save() to save obj into the database automatically. In Spring Boot, I would do something like
public interface CourseRepository extends CrudRepository<Course, String>{
}
and somehow I will get all the CRUD operations like save and findAll etc.
From another tutorial of hibernate, it says that session is required to save the object to the database. However, I don't see any form of sessionfactory or session being implemented in Spring boot and I am still able to do the save and findAll operations etc.
How is this happening and what relations does this have with hibernate? Where exactly should I start to find out more about hibernate, stuff like @OneToMany and basically understand the details of the whole application to database operations in spring boot? Thanks
Spring Boot takes care of all the session management. Refer to this question for better understanding:
Spring Boot & Spring Data: how are Hibernate Sessions managed?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With