|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/master-spring-data-jpa-with-hibernate/
课程评论:没有评论
**课程名称:** Master Spring Data JPA with Hibernate: E-Commerce Project **课程概述:** 本课程支持 Spring Boot 2 和 Spring Boot 3。您将学习如何利用 Spring Data JPA 及其特性,大幅减少重复性代码的编写。通过构建一个简单的电子商务应用,我们将创建领域模型实体(Product, ProductCategory, Order, OrderItems, User, Roles)及其对应的 Repository。 **面临的问题:** 在典型的三层 Spring Boot 应用架构(Controller, Service, DAO/Repository)中,使用 JPA/Hibernate 实现 DAO/Repository 层时,会遇到大量重复的代码。 **解决方案:** Spring Data JPA 提供了一个解决方案,可以显著减少 DAO 层所需的重复代码。它并非 JPA 提供者,而是一个在 JPA 提供者(如 Hibernate)之上增加了一个抽象层的库/框架。Spring Data JPA 默认使用 Hibernate 作为 JPA 提供者。 **课程内容:** * **Spring Data JPA 基础:** * 在 Spring Boot 应用中使用 Spring Data JPA。 * 使用 JPA 注解创建实体并映射到数据库表。 * 掌握四种主键生成策略:AUTO, IDENTITY, SEQUENCE, TABLE。 * 使用 Lombok 库减少样板代码。 * **Spring Data JPA Repository:** * 理解 Spring Data JPA Repository 接口及其层级结构。 * 学习使用 Spring Data JPA Repository 的步骤。 * 掌握重要的 Spring Data JPA Repository 方法(CRUD 操作)。 * **自定义queries:** * 通过方法命名创建查询方法 (Finder Methods)。 * 使用 `@Query` 注解创建 JPQL 和原生 SQL 查询。 * 使用命名查询 (Named Queries) 创建 JPQL 和原生 SQL 查询。 * **高级特性:** * 使用 Spring Data JPA 实现分页和排序。 * 使用 Spring Data JPA 实现 JPA/Hibernate 的一对一、一对多、多对多映射。 * 掌握 JPA 的 Cascade Types 和 Fetch Types (EAGER 和 LAZY)。 * 使用 Hibernate ORM 框架构建电子商务项目的领域模型关系。 * 实现搜索/过滤功能。 * 理解 Spring Data JPA 和 Spring Boot 的事务管理。 * 使用 `@DataJpaTest` 注解进行 Spring Data JPA Repository 的单元测试。 **工具与技术:** * **语言:** Java 11+ * **框架:** Spring Boot, Spring Data JPA, Hibernate, Lombok, JUnit * **构建工具:** Maven * **IDE:** IntelliJ IDE * **数据库:** MySQL **目标受众:** 任何希望深入学习 Spring Data JPA,特别是通过实际项目来掌握其在电子商务应用中的使用的开发者。
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 learnLearn How to Use Spring Data JPA in the Spring Boot ApplicationLearn How to Use JPA Annotations to Create an Entity and Map to a Database TableLearn 4 Types of Primary key Generation Strategies - AUTO, IDENTITY, SEQUENCE, and TABLELearn How to Use the Lombok Library to Reduce a Boilerplate CodeLearn Spring Data JPA Repository Interfaces and Its HierarchyLearn Steps to Use Spring Data JPA RepositoryLearn Important Spring Data JPA Repository Methods (CRUD Operations)Learn How to Create Query Methods or Finder Methods Using Method NamesLearn How to Create JPQL and Native SQL Queries Using @Query AnnotationLearn How to Create JPQL and Native SQL Queries With Named QueriesLearn How to Implement Pagination and Sorting Using Spring Data JPALearn JPA/Hibernate One-to-One Mapping Using Spring Data JPALearn JPA/Hibernate One to Many Mapping Using Spring Data JPALearn JPA/Hibernate Many to Many Mapping Using Spring Data JPALearn JPA Cascade Types and Fetch Types (EAGER and LAZY)Learn building domain model relationships for e-commerce projects using Hibernate ORM frameworkLearn to implement Search/Filter functionalityLearn Transaction Management with Spring Data JPA and Spring BootUnit Testing Spring Data JPA Repository using @DataJpaTest annotationTools and Technologies usedTechnologies:- Java 11+- Spring Boot- Spring Data JPA- Hibernate- Lombok- Maven- JUnit frameworkIDE:- IntelliJ IDEADatabase:- MySQL database