From the course: Java Persistence with JPA and Hibernate
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Bootstrapping JPA and Hibernate: Creating the configuration - JPA Tutorial
From the course: Java Persistence with JPA and Hibernate
Bootstrapping JPA and Hibernate: Creating the configuration
- [Instructor] Provided that you've configured your job application with the required dependencies to work with Java Persistence, Hibernate, and the MariaDB database, the next step is to tell Hibernate how to connect to the database. There are two options: using the persistence.xml file and using the programmatic approach. It doesn't really matter which option you use, but it's worth knowing both. First, I'll demonstrate to you how to use the persistence.xml file to tell Hibernate to connect to the database. Next, I'll show you what needs to be done in order to use the programmatic approach. I'm in the Codespace in branch 03_03e. To follow along, you should be in the 03_03b branch, where you can follow these steps from scratch. Now, the oldest way to tell Hibernate or any Jakarta persistence implementation how to connect to a database is using the persistence.xml configuration file. To be able to use the persistence.xml file, you should place it inside src/main and in a folder name…
Contents
-
-
-
-
-
Entities and the persistence context5m 9s
-
(Locked)
EntityManager interface4m 55s
-
(Locked)
Bootstrapping JPA and Hibernate: Creating the configuration5m 56s
-
(Locked)
Bootstrapping JPA and Hibernate: Creating the EntityManager3m 33s
-
(Locked)
Challenge: Art Class Management app, part 11m 30s
-
(Locked)
Solution: Art Class Management app, part 11m 43s
-
-
-
-
-
-
-