Object-relational Mapping Using JPA, Hibernate and Spring Data JPA. Switching between JP and Hibernate

  • We create a new Hibernate configuration #1, then call the configure method, which adds the content of the default hibernate.cfg.xml file to the configuration.
  • We explicitly add Item as annotated class #2.
  • We create a new hash map to be filled in with the existing properties #3.
  • We get all property names from Hibernate configuration #4, then we add them one by one to the previously created map #5.
  • We return a new EntityManagerFactory, providing to it the cscs persistence unit name and the previously created map of properties #6.

https://www.luxoft-training.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Happy Hacktoberfest 2020🥳

Matt Herich, From Pizza Delivery Driver to Website Development COO

Expect the unexpected..

Code Smell 55 — Object Orgy

How to Fix ERR_SSL_VERSION_INTERFERENCE Error?

Confluent cloud integration with Logz.io.

Making Readable Code With Dependency Injection and Jakarta CDI

5 Cool Linux commands to have fun on your Terminal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Luxoft Training

Luxoft Training

https://www.luxoft-training.com/

More from Medium

Lets create a java sample project part 1

Object-relational Mapping Using JPA, Hibernate and Spring Data JPA.

Flyway in Practice — How I use in my projects

Does Spring Boot Support Lazy Initialization?