Master Spring Data JPA with Hibernate: E-Commerce Project

Learn Spring Data JPA Features and Learn to Build Domain Model Relationships for E-Commerce Project Using Hibernate ORM

4.57 (313 reviews)
Udemy
platform
English
language
Web Development
category
Master Spring Data JPA with Hibernate: E-Commerce Project
2,504
students
15 hours
content
Dec 2023
last update
$74.99
regular price

What you will learn

Learn How to Use Spring Data JPA in the Spring Boot Application

Build Domain Model Relationships for E-commerce Project Using Hibernate ORM Framework

Learn How to Use JPA Annotations to Create an Entity and Map to a Database Table

Learn 4 Types of Primary key Generation Strategies - AUTO, IDENTITY, SEQUENCE, and TABLE

Learn How to Use the Lombok Library to Reduce a Boilerplate Code

Learn Spring Data JPA Repository Interfaces and Its Hierarchy

Learn Steps to Use Spring Data JPA Repository

Learn Important Spring Data JPA Repository Methods (CRUD Operations)

Learn How to Create Query Methods or Finder Methods Using Method Names

Learn How to Create JPQL and Native SQL Queries Using @Query Annotation

Learn How to Create JPQL and Native SQL Queries With Named Queries

Learn How to Implement Pagination and Sorting Using Spring Data JPA

Learn JPA/Hibernate One to One Mapping Using Spring Data JPA

Learn JPA/Hibernate One to Many Mapping Using Spring Data JPA

Learn JPA/Hibernate Many to Many Mapping Using Spring Data JPA

Learn JPA Cascade Types and Fetch Types (EAGER and LAZY)

Learn to implement Search/Filter Functionality

Learn Transaction Management with Spring Data JPA and Spring Boot

Unit Testing Spring Data JPA Repository using @DataJpaTest annotation

Why take this course?

This course supports both Spring Boot 2 and Spring Boot 3.

In this course, you will learn how to use Spring Data JPA and its features to reduce a lot of boilerplate code.


Throughout this course, we will build domain model entities (Product, ProductCategory, Order, OrderItems, User, Roles) and repositories for a simple e-commerce application.


Problem:

In typical three-layer Spring boot application architecture, we create three layers - Controller, Service, and DAO/Repository layer.

If we use JPA/Hibernate and then write a lot of coding while implementing DAO/Repository layer - We repeat the same code again and again so what will be the solution to reduce the boilerplate code?

Solution:

Spring Data JPA provides a solution to reduce a lot of boilerplate code.

We can use Spring Data JPA to reduce the amount of boilerplate code required to implement the data access object (DAO) layer.

Spring Data JPA is not a JPA provider. It is a library/framework that adds an extra layer of abstraction on top of our JPA provider (like Hibernate). Spring Data JPA uses Hibernate as a default JPA provider.

What you'll learn

  • Learn How to Use Spring Data JPA in the Spring Boot Application

  • Learn How to Use JPA Annotations to Create an Entity and Map to a Database Table

  • Learn 4 Types of Primary key Generation Strategies - AUTO, IDENTITY, SEQUENCE, and TABLE

  • Learn How to Use the Lombok Library to Reduce a Boilerplate Code

  • Learn Spring Data JPA Repository Interfaces and Its Hierarchy

  • Learn Steps to Use Spring Data JPA Repository

  • Learn Important Spring Data JPA Repository Methods (CRUD Operations)

  • Learn How to Create Query Methods or Finder Methods Using Method Names

  • Learn How to Create JPQL and Native SQL Queries Using @Query Annotation

  • Learn How to Create JPQL and Native SQL Queries With Named Queries

  • Learn How to Implement Pagination and Sorting Using Spring Data JPA

  • Learn JPA/Hibernate One-to-One Mapping Using Spring Data JPA

  • Learn JPA/Hibernate One to Many Mapping Using Spring Data JPA

  • Learn JPA/Hibernate Many to Many Mapping Using Spring Data JPA

  • Learn JPA Cascade Types and Fetch Types (EAGER and LAZY)

  • Learn building domain model relationships for e-commerce projects using Hibernate ORM framework

  • Learn to implement Search/Filter functionality

  • Learn Transaction Management with Spring Data JPA and Spring Boot

  • Unit Testing Spring Data JPA Repository using @DataJpaTest annotation


Tools and Technologies used

Technologies:

- Java 11+

- Spring Boot

- Spring Data JPA

- Hibernate

- Lombok

- Maven

- JUnit framework

IDE:

- IntelliJ IDEA

Database:

- MySQL database

Content

Introduction

Course Introduction
How to Get Help
Download Source Code and PDF Files (Class Notes)

Setting Up Your Development Environment

Install Java JDK 18 on Windows 10
Install IntelliJ IDEA in Windows 10 - IntelliJ Community (FREE) Edition
Install and Setup Spring Tool Suite 4 (STS) in Windows 10 - For STS Users
Install Lombok in Eclipse STS (Spring Tool Suite) IDE - For STS Users
Install MySQL Server 8 and MySQL Workbench in Windows 10

Getting Started with Spring Data JPA

What is Spring Data JPA?
Basic Flow of Spring Data JPA
Hibernate vs Spring Data JPA

Create and Setup Spring Boot + Spring Data JPA Project

Create and Setup Spring Boot Project in IntelliJ IDEA
Understanding Spring Boot Starter Data JPA Dependency
Connect Spring Boot Application with MySQL Database
Create Product Entity with @Entity and @Id
Using JPA Annotations - @Table, @Column, @GeneratedValue and @UniqueConstraint
Primary key generation strategies - AUTO, IDENTITY, SEQUENCE and TABLE
Adding Hibernate annotations - @CreationTimestamp and @UpdateTimestamp
Using Lombok Library to Reduce Boilerplate Code
Download Source Code of this Section
Quiz Time

Spring Data JPA Repository Interfaces and It’s Hierarchy

Understanding Spring Data JPA Repository Interfaces and it’s Hierarchy
Decompile Spring Data JPA Library to Understand Repository Interfaces
Steps to Create Spring Data JPA Repository - ProductRepository
Download Source Code of this Section
Quiz Time

Important Spring Data JPA Repository Methods

Overview of Spring Data JPA Repository Methods
save() - Save an Entity to the Database Table
save() - Update an Entity to the Database Table
findById() - Retrieve a Single Entity from the Database
saveAll() - Save Multiple Entities to the Database Table
findAll() - Retrieve All the Entities From the Database Table
deleteById() - Delete a Single Entity from the Database
delete() - Delete an Entity From the Database Table
deleteAll() - Delete All the Entities From the Database Table
count() - Get the Number of Records in the Database Table
existsById() - Check if Entity Exists With Given ID in the Database Table
Download Source Code of this Section
Quiz Time

Query Methods or Finder Methods

Overview of Creating Query Methods From Method Names Strategy
How Query Generation From Method Names Works Behind the Scene
Understanding Rules and Supported Keywords to Create Query Methods
Spring Data JPA Query Method - Find by Single Field Name
Spring Data JPA Query Method - Find by Multiple Field Names
Spring Data JPA Query Method - Find by Distinct
Spring Data JPA Query Method - Find by GreaterThan
Spring Data JPA Query Method - Find by LessThan
Spring Data JPA Query Method - Find by Containing
Spring Data JPA Query Method - Find by Like
Spring Data JPA Query Method - Find by Between (Price Range Example)
Spring Data JPA Query Method - Find by Between (Date Range Example)
Spring Data JPA Query Method - Find by In
Spring Data JPA Query Method - Limiting Query Results
Download Source Code of this Section
Quiz Time

JPQL and Native SQL Queries using @Query Annotation

Understanding @Query Annotation
Creating JPQL Query with Index Parameters using @Query
Creating JPQL Query with Named Parameters using @Query
Creating Native SQL Query with Index Parameters using @Query
Creating Native SQL Query with Named Parameters using @Query
Download Source Code of this Section
Quiz Time

Creating Named Queries

Creating Named JPQL Query using @NamedQuery Annotation
Creating Multiple Named JPQL Queries using @NamedQueries Annotation
Creating Named SQL Query using @NamedNativeQuery Annotation
Creating Multiple Named SQL Queries using @NamedNativeQueries Annotation
Download Source Code of this Section

Pagination and Sorting

Understanding Spring Data JPA Pagination and Sorting
Spring Data JPA - Pagination Implementation
Spring Data JPA - Sorting Implementation
Spring Data JPA - Implement Sorting with Multiple Fields
Spring Data JPA - Implement Paging and Sorting Together
Download Source Code of this Section
Quiz Time

One to One Mapping (@OneToOne)

One-To-One Mapping Overview
Unidirectional One-To-One Mapping Overview
Create Order and Address Entities
Establish Unidirectional One-To-One Mapping
Create OrderRepository and AddressRepository
Understanding JPA Cascade Types
Test Unidirectional One-To-One Mapping (CRUD Operations)
Bidirectional One-To-One Mapping
Establish Bidirectional One-To-One Mapping
Test Bidirectional One-To-One Mapping (CRUD Operations)
Download Source Code of this Section

One to Many Mapping (@OneToMany and @ManyToOne)

One to Many Mapping Overview
Unidirectional One-To-Many Mapping Overview
Create OrderItem Entity and Establish Unidirectional One-To-Many Mapping
Fetch Types - Eager vs Lazy
Test One-To-Many Unidirectional Mapping (CRUD Operations) - Part 1
Test One-To-Many Unidirectional Mapping (CRUD Operations) - Part 2
Bidirectional One-To-Many Mapping Overview
Bidirectional One-To-Many Mapping Between Order and OrderItem
Download Source Code of this Section

One to Many Mapping (ProductCategory and Product)

One-To-Many Mapping Between Product and ProductCategory
Testing One-To-Many Mapping (Save Operation)
FetchType.Lazy Demonstration
Download Source Code of this Section

Many to Many Mapping (@ManyToMany)

Many to Many Mapping Overview
Unidirectional Many-To-Many Mapping Overview
Create User and Role Entities
Establish Unidirectional Many-To-Many Mapping Between User and Role
Create UserRepository and RoleRepository
Test Unidirectional Many-To-Many Mapping (CRUD Operations)
Bidirectional Many-To-Many Mapping Overview
Establish Bidirectional Many-To-Many Mapping Between User and Role
Test Bidirectional Many-To-Many Mapping
Download Source Code of this Section

Implementing the Search Functionality

Create Spring Boot Project
Configure MySQL Database
Create Product JPA Entity
Create ProductRepository Interface
Create JPQL and Native SQL queries for Search REST API
Create Service Layer
Build Search REST API and Test using Postman
Download Source Code of this Section

Transaction Management with Spring Data JPA (Spring Boot)

Module Intro - What You Will Learn in This Section?
Transaction Management with Spring Data JPA
Use Case - Placing Order on eCommerce Shopping Website
Create and Setup Spring Boot Project in IntelliJ
Configure MySQL Database
Create Order and Payment JPA Entities
Create OrderRepository and Payment Repository Interfaces
Create OrderRequest and OrderResponse DTO Classes
Create Service Layer
Create Place Order REST API and Test using Postman
Handle Transaction using Spring @Transactional Annotation
Download Source Code of this Section

Unit Testing Spring Data JPA Repository layer - @DataJpaTest

Repository Layer Unit Testing Overview
@DataJpaTest Annotation
Create and Setup Spring Boot project in IntelliJ IDEA
Understanding Spring boot Starter Test Dependency
Create JPA Entity
Create Spring Data JPA Repository
Unit Test for Save Employee Operation
Unit Test for Delete Employee Operation
Unit Test for Get All Employees Operation
Unit Test for Get Employee by Email Operation (Spring Data JPA Query Method)
Unit Test for Update Employee Operation
Unit Test for Get Employee by ID Operation
Unit Test Spring Data JPA Custom Query Method Using JPQL With Index Param
Unit Test Spring Data JPA Custom Query Method Using JPQL With Named Param
Unit Test Spring Data JPA Custom Native Query With Index Parameters
Unit Test Spring Data JPA Custom Native Query With Named Parameters
Refactoring JUnit Tests to Use @BeforeEach Annotation
Download Source Code of this Section

Reviews

Nam
October 8, 2023
All lessons are very detail. I learn a lot about Spring Data JPA and Hibernate from this course. But sometimes, knowledge may be repeated or no need to talk then it makes course longer.
Vinícius
August 7, 2023
Language accessible even to non-English speakers, and pace appropriate to the purpose of the course. Highly recommend!
Srinivas
August 2, 2023
This is a basic course. It doesn't cover all the concepts that are required for you in the real world. The knowledge of this course alone is not enough for you to work on complex projects.
Umamaheshwar
July 23, 2023
Good Course. It's a practical real time course you have to apply these skills when working in company.
Gazi
July 16, 2023
The overall course content is good. Thanks to make everything easy to understand. However, from my observation, I have points that could make the course better. He cover the same topic again and again, creating projects, repositories, and models were instructed on how could we do that but he made different lectures for these making the course content long. Some statements are repeated multiple times. Never tried to give any deep explanation. I feel some places I need some extra explanation but that was missing. However, the basic concept got covered nicely. Thanks
John
July 11, 2023
The course was great, the concepts were covered adequately and the instructor uses repetition to cement the concepts. It was great.
Ravi
April 27, 2023
This is a really good course to understand how to use Spring Data JPA to build DAO layer of your application. All important concepts are well explained and demonstrated via a working example. One small point I have is that all the tests (using @SpringBootTest) written as part of hands-on labs are not real unit tests because they are not using any assertions. If you are writing unit tests or integration tests then kindly make sure they do what they are suppose to. Other than this small point, I really liked this course and recommend in highly to anyone interested in learning basics of Spring Data JPA and some more.
Ankit
April 25, 2023
Excellent Learning Experience with java guides. I will highly recommended to every professional software programmers and engineers.
Oleksandr
April 9, 2023
Hello. First I say thanks to author for valuable information in this course. The course fully explains all the necessary information and I am satisfied with the result. But I want to add that the course can be made even better if you fill the database with data from the real world. I mean, if the database didn't have the names "product1", "product2", "product description1", "product description2", etc., but real several hundred records with full descriptions, it would be better for mastering information But apart from this nuance, the course is very useful.
Chetan
April 3, 2023
This is a Fantastic Course. If you are planning to learn Spring Data JPA, Please take this course. Thanks Ramesh Sir for your great efforts for putting things in a simple manner.
Anders
November 24, 2022
Talking to fast. Well if you are natural English speaker then you can talk like a formula 1 driver drives but when you have a pretty strong foreign accent then it is pretty hard to understand.
Ryan
October 15, 2022
Because of taking Ramesh’s course i got an internship. Im working on spring projects and Ramesh’s course is still a great guide
Meena
July 6, 2022
Amazing course. I recommend this course if you want to learn Spring Data JPA in-depth with coding. Very responsive teacher (reply immediately)
Rao
June 7, 2022
Amazing course. Practical course, you will learn the concepts line by line coding. Amazing teacher. Amazing, above expectations!

Coupons

DateDiscountStatus
12/2/202278% OFF
expired

Charts

Price

Master Spring Data JPA with Hibernate: E-Commerce Project - Price chart

Rating

Master Spring Data JPA with Hibernate: E-Commerce Project - Ratings chart

Enrollment distribution

Master Spring Data JPA with Hibernate: E-Commerce Project - Distribution chart

Related Topics

4696514
udemy ID
5/21/2022
course created date
6/7/2022
course indexed date
Bot
course submited by