Mô tả

Hibernate is the default JPA implementation used by Spring Data JPA.

NOTE: Java 17 and Spring Boot 3 are required for this course.

JPA stands for Java Persistence API. This is a common Java API used to work with Relational Databases.

Spring Data JPA is an abstraction built on top of the JPA API specification.

Being an abstraction, Spring Data JPA makes working with database entities very efficient.

Spring Data JPA eliminates a lot of the boilerplate / cerimonial code, and allows developers to focus on developing business logic.

The downside of the efficient abstraction is that accessing the database can become a mystery. Developers who just understand how to use Spring Data JPA do not understand the complexities of JDBC and Hibernate.

You will start this course with a basic demonstration of Spring Data JPA. In this section you will learn how to work with a H2 in-memory database.

You'll see how easy it is to work with Spring Data JPA. You will also begin to understand how the Hibernate interaction is being abstracted away.

Since JPA is the Java API for working with Relational Databases, the course takes a closer look at Relational Databases and MySQL specifically.

MySQL is the most popular open source relational database in the world. You will learn how to configure Spring Boot to test with a H2 in-memory database and to run integration tests against a MySQL database. This is a common real-world example leveraging the power of Spring and Hibernate to give you a very flexible environment.

Once we've established a persistent database, we can explore using database migration tools.

Liquibase and Flyway are two very popular database migration tools. Spring Boot supports both options. And you will learn about both options and database security best practices.

By establishing a MySQL database, Spring Boot Integration Tests, and automated database migrations we can use Test Driven Development to explore the features of JDBC and Hibernate.

In the course you will learn:

  • What is the DAO pattern, and how to implement it using JDBC, Spring's JDBCTemplate, and Hibernate

  • Relational Database Principles

  • Schema Creation in MySQL

  • Schema Generation using Hibernate

  • Database Migrations using Liquibase

  • Database Migrations using Flyway

  • Database Integration Testing using Spring Boot and JUnit 5

  • Defining Primary Key's with Hibernate

  • Hibernate Criteria Queries

  • Named JPA Queries

  • Spring Data JPA query methods

  • Spring Data JPA @Query Annotation

  • Entity Relationships - One to One, One to Many, Many to One, Many to Many

  • Embedded Types

  • Natural Keys

  • Composite Keys

  • Spring Data JPA Query Methods

  • Paging and Sorting

  • Database Transaction Management

  • Database Fetch Operations

  • Data Validation

  • JPA Inheritance

  • Hibernate Interceptors and Listeners

  • JPA Callbacks

  • Legacy Database Mapping

  • Using Multiple Data Sources

  • Spring Data REST

Learn Hibernate and Spring Data JPA - Enroll today!

Bạn sẽ học được gì

Yêu cầu

Nội dung khoá học

28 sections

Introduction

7 lectures
Introduction
02:12
Getting the Most out of this Course
05:15
Setting up your Development Environment
05:08
GitHub Work Flow
12:20
Slack Group
00:51
Is your IDE Free Like A Puppy?
02:45
IntelliJ 120 Day Free Trial
00:42

Introduction to Spring Data JPA

9 lectures
Introduction
02:03
Introduction to Spring Data JPA
14:32
Use Spring Initializr to Create Project
06:15
JPA Entities
06:04
Equality in Hibernate
03:52
Spring Data Repositories
06:43
Initializing Data with Spring
08:03
SQL Logging
05:16
H2 Database Console
03:46

Introduction to MySQL

9 lectures
Introduction
01:21
What is a Database?
04:21
Relational Database Principles
12:08
What is a Relational Database Management System
08:35
History of MySQL
05:08
RDBMS Deployment Architectures
06:42
Data Mapping SQL to Java
06:35
Assignment - Install MySQL
1 question
Create Schema and User for Spring Boot
12:07

Introduction to Testing with Spring Boot

5 lectures
Introduction
01:31
Spring Boot Test
04:45
Spring Boot JPA Test Splice
05:21
Test Transactions
08:05
Bootstrapping Data
04:04

Hibernate with MySQL

8 lectures
Introduction
01:18
Hibernate DDL Update Modes
07:43
MySQL Spring Boot Configuration
08:11
Integration Test for MySQL
09:38
H2 MySQL Compatibility Mode
07:42
Schema Initialization with Hibernate
06:07
Schema Initialization with MySQL
03:08
Use H2 for Spring Boot Application
04:49

Using Liquibase

9 lectures
Introduction
01:17
Overview of Liquibase
11:08
Liquibase Maven Plugin
07:40
Generate Changeset from Database
05:27
Organizing Change Logs
05:50
Spring Boot Configuration
07:45
Initializing Data with Spring
06:42
Assignment - Add Table with Liquidbase
1 question
Alter Table with Liquibase
08:46

Using Flyway

6 lectures
Introduction
00:54
Overview of Flyway
10:05
Spring Boot Configuration
10:16
Assignment Add Table with Flyway
1 question
Alter Table with Flyway
05:24
Clean and Rebuild with Flyway
04:46

Hibernate Primary Keys

11 lectures
Introduction
01:52
Hibernate Primary Keys Overview
06:52
Auto Incremented Primary Key
06:27
Vendor Specific Flyway Migrations
06:42
UUID Primary Key
07:39
UUID RFC 4122 Primary Key
07:13
H2 Workaround
05:47
Assignment - Unit Tests for UUID Primary Keys
1 question
Natural Primary Key
05:33
Composite Primary Key
06:37
Embedded Composite Primary Key
07:12

DAO Pattern with JDBC

15 lectures
Introduction
02:13
Assignment - Create Book Database Project
1 question
Introduction to DAO Pattern
05:11
Create Author DAO
08:46
Implement Get Author By Id
07:54
Release Database Resources
05:44
IntelliJ Database Configuration
03:49
Using Prepared Statements
06:32
Assignment - Find Author By Name
1 question
Refactoring Duplicate Code
05:27
Save New Author
08:28
Update Author
05:44
Delete Author
06:26
Assignment - Implement Book DAO
1 question
Refactor Author id to Author
10:07

Spring JDBC Template

11 lectures
Introduction
01:24
Introduction to Spring JDBC Template
02:39
Assignment - Create Author DAO
1 question
Create Row Mapper
03:36
Implement Get Author By Id
04:53
Implement Find Author By Name
02:24
Save New Author
06:31
Update Author
03:41
Delete Author
03:59
Assignment - Implement Book DAO
1 question
Implement Author with List of Books
16:11

Hibernate DAO

9 lectures
Introduction
01:01
Introduction to Hibernate
08:52
Project Code Review
04:05
Implement Get Author By Id
05:18
Implement Find Author By Name
07:04
Save New Author
06:57
Update Author
04:45
Delete Author
03:54
Assignment - Implement Book DAO
1 question

Hibernate Queries

10 lectures
Introduction
00:51
Query
04:24
Typed Query
04:07
Named Query
04:40
Named Query with Parameters
05:00
Assignment Create Named Queries
1 question
Criteria Query
09:16
Assignment Create Criteria Query
1 question
Native SQL Queries
07:12
Assignment Create Native SQL Query
1 question

Spring Data JPA Queries

14 lectures
Introduction
01:15
Spring Data JPA Query Methods
03:32
Project Code Review
03:13
Author CRUD Operations
06:58
Query Methods
03:22
Optional Return Type
03:35
Assn - Implement Book DAO
1 question
Null Handling
05:52
Stream Query Results
04:36
Asynchronous Query Results
04:30
Declaring Queries Using @Query
03:20
Named Parameters with @Query
03:09
Native SQL Queries
03:04
JPA Named Queries
03:43

Paging and Sorting

15 lectures
Introduction
01:05
Overview of Paging and Sorting
04:22
JDBCTemplate Code Review
02:42
Find All Books with JDBCTemplate
04:18
Find All Books with Paging
05:26
Find All Books Using Pagable
06:26
Find All Books Order By Title
10:03
Assignment - Find Author by Last Name
1 question
Hibernate Code Review
02:12
Paging with Hibernate
05:13
Sorting with Hibernate
04:03
Implement Hibernate Author DAO
1 question
Paging with Spring Data JPA
06:29
Sorting with Spring Data JPA
05:02
Query, Paging, and Sorting with Spring Data JPA
05:22

Hibernate Java Mappings

9 lectures
Introduction
01:27
Create New Project
1 question
JPA Inheritance
10:22
JPA Mapped Super Class
06:06
Embedded Types
11:34
Java Enumerated Types
05:17
Hibernate Created Date
03:49
Hibernate Update Date
03:31
Assignment - Add Product Entity
1 question

Database Relationship Mappings

15 lectures
Introduction
01:16
Overview of Database Relationships
10:42
One to Many
08:45
Cascade on Persist
08:06
Many to One Unidirectional
06:49
Association Helper Methods
04:16
Many to Many
12:30
JPA Buddy Plugin
06:48
Create Customer Entity
1 question
One to One
05:19
Cascade Persist
1 question
Cascade Delete
06:11
Orphan Removal
05:59
One to One Bi-Directional
06:35
Hibernate Cascade Types
03:16

Fetch Operations

5 lectures
Introduction
01:03
Load Test Data
18:08
Load Test Data Fix
05:39
Lazy vs Eager Fetch
08:53
Hibernate N + 1 Problem
13:18

Database Transactions & Locking

14 lectures
Introduction
01:11
Overview of Database Transactions
18:47
Database Locking Demo
07:43
Spring Data JPA Transactions
18:49
Create Bootstrap Class
03:28
Lazy Initialize Error
05:26
Transactional Proxy Mode
05:24
Adding Version Property
04:48
Optimistic Locking Demo
06:54
Optimistic Locking to Orders
1 question
Version Property Cannot Be Null
05:14
Add Quantity On Hand to Product
1 question
Pessimistic Locking
09:26
Fix Pessimistic Locking Error
1 question

Validation

6 lectures
Introduction
01:04
Java Bean Validation Overview
11:01
Java Bean Validation Maven Dependencies
02:35
Adding Validation
08:39
Complete Customer Validation
1 question
When and Where to Use Validation?
05:40

Inheritance

7 lectures
Introduction
01:17
Overview of JPA Inheritance
03:22
Project Code Review
01:59
Mapped Super Class
04:28
Table Per Class
06:40
Single Table
05:42
Joined Table
07:42

Legacy Database Mapping

15 lectures
Introduction
02:17
Overview
03:03
Initial Project Creation
04:03
Database Setup
02:03
Spring Configuration
04:15
Flyway Initialization Script
04:38
Table and Column Naming
05:50
LOB Columns
02:45
Basic Annotation
02:50
Add Validation
1 question
Column Properties
05:10
Database Indexes
03:26
Refactor for Bi-Directional Association
04:13
Map Comment and Comment Meta Tables
1 question
Summary
03:09

Hibernate Interceptors

9 lectures
Introduction
01:30
Overview of Listeners and Interceptors
04:23
Project Code Review
05:03
Initial Persistence Test
05:35
Encryption Service
05:18
Verify Data at Rest
04:15
Create Hibernate Interceptor
06:18
Custom Encryption Annotation
01:44
Implement Encryption Interceptor
08:21

Hibernate Listeners

5 lectures
Introduction
01:16
Remove Listener Example
02:14
Create Hibernate Listeners
02:19
Register Hibernate Listeners
08:11
Implement Hibernate Encryption Listeners
05:56

JPA Callbacks

7 lectures
Introduction
02:06
Disable Hibernate Event Listeners
01:35
JPA Callback on Entity Methods
02:55
JPA Callback Listener
03:32
Spring Context Helper
03:15
Implement Callback Encryption
03:08
JPA Converters
04:55

Multiple Data Sources

21 lectures
Introduction
01:51
Project Code Review
02:50
Adding Project Lombok
06:27
My SQL Configuration
02:50
Data Source Properties
04:22
Create Data Source Connections
03:10
Create Entity Managers
04:41
Create Transaction Managers
02:53
Spring Data JPA Repository Configuration
04:23
Create Flyway Migration Scripts
04:30
Flyway Datasource Configuration
03:26
Custom Flyway Migrations
03:42
Flyway Migration Testing
04:08
Hikari Database Pooling Properties
04:33
Configure Hibernate Schema Validation
03:38
Configure Hibernate Naming Conventions
06:19
Hibernate Transient Properties
02:44
Create Credit Card Id References
04:46
Save New Credit Card
05:43
Get Credit Card by Id
04:59
Summary
02:47

Intro to Spring Data REST

12 lectures
Introduction
02:14
Project Code Review
04:57
Add Spring Data REST Dependency
02:38
List All With Spring Data REST
04:25
Set Base Path
01:53
Customize URL Path
04:56
Version Property - ETag Header
02:46
API Profile
03:45
Create with Spring Data REST
02:39
Update Data with Spring Data REST
02:13
Delete Data with Spring Data REST
01:51
Use Repository Methods
02:46

Appendix A: Using GitHub

2 lectures
Git and GitHub Basics - Start here!
00:44
GitHub Workflow
12:20

Appendix B: Spring Framework Videos from Udemy YouTube

9 lectures
Introduction
00:04
Restful Web Services with Spring MVC
49:47
Dependency Injection Best Practices
18:49
Introduction to Testing with Spring
17:28
Introduction to MockMVC
04:36
Building a Spring Boot Application
30:32
Kube By Example - Building a Spring Boot Docker Images
56:33
Kube By Example - Spring Boot on Kubernetes
47:46
Kube By Example - Spring Boot Microservices on Kubernetes
01:51:22

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.