Skip to content

Commit 629caec

Browse files
author
kmsoln
committed
[Master] Added Chinese files
1 parent a86b0dc commit 629caec

40 files changed

Lines changed: 792 additions & 808 deletions

‎README-CN.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55
### 教程
66

7-
1. **第1课: [Thymeleaf](docs/en/thymeleaf/lab-work.md)**
7+
1. **第1课: [Thymeleaf](docs/cn/thymeleaf/lab-work.md)**
88

99
Thymeleaf教程提供了在Spring应用中设置Thymeleaf的实用指南。在本教程中,参与者将进行与视图设置、变量操作和其他重要功能相关的任务。
1010

11-
2. **第2课: [Spring Security](docs/en/springsecurity/lab-work.md)**
11+
2. **第2课: [Spring Security](docs/cn/springsecurity/lab-work.md)**
1212

1313
本教程深入探讨了在Spring应用中使用Spring Security的安全机制。参与者将学习如何设置认证和授权机制,保护路径和资源,实现自定义登录表单以及其他相关的安全实践。
1414

15-
3. **第3课: [JPA (Java Persistence API)](docs/en/jpa/lab-work.md)**
15+
3. **第3课: [JPA (Java Persistence API)](docs/cn/jpa/lab-work.md)**
1616

1717
JPA教程提供了在Spring应用中使用Java Persistence API的实用指南。参与者将学习如何使用JPA与数据库交互,执行CRUD操作,管理实体之间的关系以及其他重要的数据持久化任务。
1818

19-
4. **第4课: [事务](docs/en/transactions/lab-work.md)**
19+
4. **第4课: [事务](docs/cn/transactions/lab-work.md)**
2020

2121
本教程深入探讨了不同传播和隔离场景下的事务管理。参与者将学习事务控制、不同的隔离级别和传播场景,从而深入理解在Spring应用中管理事务。
2222

23-
5. **第5课: [JMeter](docs/ru/jmeter/lab-work.md)**
23+
5. **第5课: [JMeter](docs/cn/jmeter/lab-work.md)**
2424

2525
JMeter系列教程提供了使用JMeter进行负载测试和性能分析的完整指南。参与者将学习如何设置JMeter、记录HTTP请求、创建和执行测试场景,以及分析测试结果。
2626

‎docs/cn/jmeter/lab-work.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ The primary goal of this lab work is to provide you with practical experience an
2323
## Lab Work Tasks <a name="lab-work-tasks"></a>
2424

2525
idk :D
26+

‎docs/cn/jpa/lab-work.md‎

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,54 @@
1-
# Lab Work: JPA (Java Persistence API)
1+
# 实验任务: JPA (Java Persistence API)
22

3-
Welcome to the Spring Boot with JPA Lab Work! In this lab work, you will practice various tasks related to setting up a Spring Boot project with JPA (Java Persistence API).
3+
欢迎来到 Spring Boot with JPA 实验任务!在这个实验中,您将练习与使用 Spring Boot 和 JPA (Java Persistence API) 相关的各种任务。
44

5-
## Goal of the Lab Work
5+
## 实验任务的目标
66

7-
The goal of this lab work is to provide hands-on experience with key concepts and tasks involved in working with Spring Boot and JPA. By completing the practice tasks, you will gain proficiency in setting up dependencies, defining entity characteristics, managing relationships between entities, and interacting with the database using JpaRepository.
7+
这个实验的目标是提供与 Spring Boot 和 JPA 相关的关键概念和任务的实践经验。通过完成练习任务,您将掌握设置依赖关系、定义实体特性、管理实体之间关系以及使用 JpaRepository 与数据库交互等方面的技能。
88

9-
## Practice Tasks <a name="practice-tasks"></a>
9+
## 练习任务
1010

11-
1. **Database Dependencies Setup**
12-
- [Database Driver Setup](practice/dependencies/driver.md)
13-
- [Spring Boot and JPA Dependencies](practice/dependencies/jpa.md)
11+
1. **设置数据库依赖关系**
12+
- [设置数据库驱动程序](practice/dependencies/driver.md)
13+
- [Spring Boot 和 JPA 依赖关系](practice/dependencies/jpa.md)
1414

15-
2. **Entity Creation, Characteristics, Relationships and Fetching Strategies**
16-
- [Entity Creation](practice/creation/create-entity.md)
17-
- [Entity Characteristics Definition](practice/creation/characteristics.md)
18-
- [Managing Relationships](practice/creation/relationships.md)
19-
- [Fetching Strategies](practice/creation/fetching.md)
15+
2. **实体创建、特性、关系和获取策略**
16+
- [创建实体](practice/creation/create-entity.md)
17+
- [定义实体特性](practice/creation/characteristics.md)
18+
- [管理关系](practice/creation/relationships.md)
19+
- [获取策略](practice/creation/fetching.md)
2020

21-
3. **Interacting with Custom Repository**
22-
- [Create Record](practice/interacting/repository/create.md)
23-
- [Read Record](practice/interacting/repository/read.md)
24-
- [Update Record](practice/interacting/repository/update.md)
25-
- [Delete Record](practice/interacting/repository/delete.md)
26-
- [Custom Queries](practice/interacting/repository/query.md)
21+
3. **与自定义存储库交互**
22+
- [创建记录](practice/interacting/repository/create.md)
23+
- [读取记录](practice/interacting/repository/read.md)
24+
- [更新记录](practice/interacting/repository/update.md)
25+
- [删除记录](practice/interacting/repository/delete.md)
26+
- [自定义查询](practice/interacting/repository/query.md)
2727

28-
4. **Interacting with JPA Repository**
29-
- [Create Record](practice/interacting/jpa-repository/create.md)
30-
- [Read Record](practice/interacting/jpa-repository/read.md)
31-
- [Delete Record](practice/interacting/jpa-repository/delete.md)
32-
- [Custom Queries](practice/interacting/jpa-repository/query.md)
28+
4. **与 JPA 存储库交互**
29+
- [创建记录](practice/interacting/jpa-repository/create.md)
30+
- [读取记录](practice/interacting/jpa-repository/read.md)
31+
- [删除记录](practice/interacting/jpa-repository/delete.md)
32+
- [自定义查询](practice/interacting/jpa-repository/query.md)
3333

3434

35-
## Lab Work Tasks <a name="lab-work-tasks"></a>
35+
## 实验任务
3636

37-
1. Set up database dependencies for PostgreSQL, MySQL, Oracle, MongoDB, and Microsoft SQL Server.
37+
1. 为 PostgreSQL、MySQL、Oracle、MongoDB 和 Microsoft SQL Server 设置数据库依赖关系。
3838

39-
2. Implement the next Entity-Relationships Diagram:
40-
![img.png](../../srcs/jpa/task-er-diagram.png)
39+
2. 实现下一个实体关系图:
40+
![img.png](../../srcs/jpa/task-er-diagram.png)
4141

42-
1. Define entity characteristics for Student, Enrollment, and Course entities based on the Entity Relationships diagram.
42+
1. 根据实体关系图定义 Student、Enrollment 和 Course 实体的特性。
4343

44-
2. Create entity classes for Student, Enrollment, and Course according to the defined characteristics.
44+
2. 根据定义的特性创建 Student、Enrollment 和 Course 实体类。
4545

46-
3. Implement fetching strategies for efficient data retrieval to optimize database interactions.
46+
3. 实现有效的数据检索获取策略,以优化数据库交互。
4747

48-
4. Manage relationships between entities such as Student, Enrollment, and Course by establishing appropriate associations and mappings.
48+
4. 通过建立适当的关联和映射,管理实体之间的关系,如 Student、Enrollment 和 Course。
4949

50-
5. Interact with the database by creating methods for CRUD operations using the Repository layer and EntityManager in at least two repositories.
50+
5. 通过在至少两个存储库中使用 Repository 层和 EntityManager,创建用于 CRUD 操作的方法,与数据库进行交互。
5151

52-
6. Interact with the database by creating methods for CRUD operations using JpaRepository in at least two repositories.
53-
54-
7. Implement custom queries to perform advanced data retrieval and manipulation operations as required by the application's business logic.
52+
6. 通过在至少两个存储库中使用 JpaRepository,创建用于 CRUD 操作的方法,与数据库进行交互。
5553

54+
7. 根据应用程序的业务逻辑需求,实现自定义查询,执行高级数据检索和操作。
Lines changed: 41 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,100 @@
1-
# Defining Entity Characteristics
1+
## 实体特性
22

3-
## Introduction
3+
### 学生实体特性:
44

5-
This guide focuses on defining entity columns or characteristics in a Spring Boot project using JPA (Java Persistence API).
5+
- `id`(UUID):实体的主键。
6+
- `name`(String):学生的姓名(不能为空)。
7+
- `email`(String):学生的电子邮件地址(必须是有效的电子邮件地址)。
8+
- `major`(String):学生的专业或研究领域(不能为空)。
9+
- `year`(int):学生的年级(不能为空)。
10+
- `international`(boolean):指示学生是否为国际学生(不能为空)。
611

7-
## Goal
8-
The goal of this guide is to provide clear instructions for defining the characteristics of entities in a Spring Boot project with JPA, utilizing annotations to enforce constraints and behaviors for each attribute.
12+
### 定义 `id` 属性
913

10-
11-
## Entity Characteristics
12-
13-
### Student Entity Characteristics:
14-
- `id` (UUID): Primary key for the entity.
15-
- `name` (String): Name of the student (must not be blank).
16-
- `email` (String): Email address of the student (must be a valid email address).
17-
- `major` (String): Major or field of study of the student (must not be blank).
18-
- `year` (int): Year of study for the student (must not be null).
19-
- `international` (boolean): Indicates if the student is international (must not be null).
20-
21-
### Define `id` Attribute
22-
23-
Add the `id` attribute to the `Student` class. This attribute will serve as the primary key for the entity.
14+
向 `Student` 类添加 `id` 属性。该属性将作为实体的主键。
2415

2516
```java
2617
@Id
2718
@GeneratedValue(strategy = GenerationType.AUTO)
2819
private UUID id;
2920
```
3021

31-
- `@Id`: Indicates that this field is the primary key for the entity.
32-
- `@GeneratedValue`: Specifies the strategy for generating primary key values automatically.
22+
- `@Id`:表示该字段是实体的主键。
23+
- `@GeneratedValue`:指定生成主键值的策略。
3324

34-
### Define `name` Attribute
25+
### 定义 `name` 属性
3526

36-
Add the `name` attribute to the `Student` class. This attribute represents the name of the student and must not be blank.
27+
向 `Student` 类添加 `name` 属性。该属性表示学生的姓名,不能为空。
3728

3829
```java
3930
@NotBlank
4031
private String name;
4132
```
4233

43-
- `@NotBlank`: Ensures that the value of `name` is not null and contains at least one non-whitespace character.
34+
- `@NotBlank`:确保 `name` 的值不为 null 并包含至少一个非空白字符。
4435

45-
### Define `email` Attribute
36+
### 定义 `email` 属性
4637

47-
Add the `email` attribute to the `Student` class. This attribute represents the email address of the student and must be a valid email address.
38+
向 `Student` 类添加 `email` 属性。该属性表示学生的电子邮件地址,必须是有效的电子邮件地址。
4839

4940
```java
5041
@NotBlank
5142
@Email
5243
private String email;
5344
```
5445

55-
- `@Email`: Validates that the value of `email` is a valid email address.
46+
- `@Email`:验证 `email` 的值是否为有效的电子邮件地址。
5647

57-
### Define `major` Attribute
48+
### 定义 `major` 属性
5849

59-
Add the `major` attribute to the `Student` class. This attribute represents the major or field of study of the student and must not be blank.
50+
向 `Student` 类添加 `major` 属性。该属性表示学生的专业或研究领域,不能为空。
6051

6152
```java
6253
@NotBlank
6354
private String major;
6455
```
6556

66-
- `@NotBlank`: Ensures that the value of `major` is not null and contains at least one non-whitespace character.
57+
- `@NotBlank`:确保 `major` 的值不为 null 并包含至少一个非空白字符。
6758

68-
### Define `year` Attribute
59+
### 定义 `year` 属性
6960

70-
Add the `year` attribute to the `Student` class. This attribute represents the year of study for the student and must not be null.
61+
向 `Student` 类添加 `year` 属性。该属性表示学生的年级,不能为空。
7162

7263
```java
7364
@NotNull
7465
private int year;
7566
```
7667

77-
- `@NotNull`: Ensures that the value of `year` is not null.
68+
- `@NotNull`:确保 `year` 的值不为 null。
7869

79-
### Define `international` Attribute
70+
### 定义 `international` 属性
8071

81-
Add the `international` attribute to the `Student` class. This attribute indicates whether the student is international and must not be null.
72+
向 `Student` 类添加 `international` 属性。该属性表示学生是否为国际学生,不能为空。
8273

8374
```java
8475
@NotNull
8576
private boolean international;
8677
```
8778

88-
- `@NotNull`: Ensures that the value of `international` is not null.
89-
90-
91-
You can repeat the previous steps to create entity characteristics for the `Course` and `Enrollment` entities, ensuring appropriate annotations are applied to each attribute.
79+
- `@NotNull`:确保 `international` 的值不为 null。
9280

93-
### Enrollment Entity Characteristics:
81+
您可以重复上述步骤,为 `Course` 和 `Enrollment` 实体创建实体特性,确保为每个属性应用适当的注释。
9482

95-
- `id` (UUID): Primary key for the entity.
96-
- `enrollmentDate` (Date): Date of enrollment.
97-
- `grade` (int): Grade achieved in the course.
83+
### Enrollment 实体特性:
9884

99-
### Course Entity Characteristics:
85+
- `id`(UUID):实体的主键。
86+
- `enrollmentDate`(Date):注册日期。
87+
- `grade`(int):课程中获得的成绩。
10088

101-
- `id` (UUID): Primary key for the entity.
102-
- `name` (String): Name of the course.
103-
- `instructor` (String): Name of the course instructor.
104-
- `schedule` (String): Schedule details of the course.
105-
- `capacity` (int): Maximum capacity of the course.
106-
- `online` (boolean): Indicates if the course is online.
107-
- `startDate` (Date): Start date of the course.
89+
### Course 实体特性:
10890

91+
- `id`(UUID):实体的主键。
92+
- `name`(String):课程名称。
93+
- `instructor`(String):课程讲师姓名。
94+
- `schedule`(String):课程的安排详情。
95+
- `capacity`(int):课程的最大容量。
96+
- `online`(boolean):指示课程是否在线。
97+
- `startDate`(Date):课程的开始日期。
10998
---
11099

111-
# [Next: Managing Relationships](relationships.md)
100+
# [下一步:管理关系](relationships.md)
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Creating Entities
1+
# 创建实体
22

3-
## Introduction
3+
## 介绍
44

5-
This guide focuses on creating entities in a Spring Boot project using JPA (Java Persistence API). It provides step-by-step instructions for setting up the folder structure and creating entity classes.
5+
本指南侧重于使用JPA(Java Persistence API)在Spring Boot项目中创建实体。它提供了逐步的说明,用于设置文件夹结构和创建实体类。
66

7-
## Goal
7+
## 目标
88

9-
The goal of this guide is to demonstrate how to create entity classes in a Spring Boot project, following best practices and utilizing JPA for data persistence.
9+
本指南的目标是演示如何在Spring Boot项目中创建实体类,遵循最佳实践并利用JPA进行数据持久化。
1010

11-
## Folder Structure
11+
## 文件夹结构
1212

13-
To ensure a well-organized project, it's essential to establish a proper folder structure. Follow these guidelines:
13+
为了确保项目组织良好,建立正确的文件夹结构至关重要。请遵循以下准则:
1414

1515
```
1616
src/
@@ -26,19 +26,19 @@ src/
2626
2727
```
2828

29-
In this structure:
30-
- The `src/main/java` directory contains your Java source files.
31-
- The `com/example/demo/entity` directory is where you'll create your entity classes.
29+
在这个结构中:
30+
- `src/main/java` 目录包含您的Java源文件。
31+
- `com/example/demo/entity` 目录是您将创建实体类的地方。
3232

33-
## Creating Entity Classes
33+
## 创建实体类
3434

35-
To create entity classes, follow these steps:
35+
要创建实体类,请按照以下步骤操作:
3636

37-
1. Navigate to the `com/example/demo/entity` directory in your project.
38-
2. Create a new Java class file for each entity. You can repeat the following steps for each entity (e.g., Student, Enrollment, Course).
39-
3. Define your entity class with the `@Entity` annotation.
37+
1. 导航到您项目中的 `com/example/demo/entity` 目录。
38+
2. 为每个实体创建一个新的Java类文件。您可以为每个实体(例如,Student、Enrollment、Course)重复以下步骤。
39+
3. 使用 `@Entity` 注解定义您的实体类。
4040

41-
### Example:
41+
### 示例:
4242

4343
```java
4444
package com.example.demo.entity;
@@ -51,10 +51,10 @@ public class Student {
5151
}
5252
```
5353

54-
The `@Entity` annotation indicates that this class is a JPA entity.
54+
`@Entity` 注解表示该类是一个JPA实体。
5555

56-
Repeat the above steps to create `Enrollment` and `Course` entity classes.
56+
重复以上步骤以创建 `Enrollment` 和 `Course` 实体类。
5757

5858
---
5959

60-
# [Next: Entity Characteristics Definition](characteristics.md)
60+
# [下一步:实体特征定义](characteristics.md)

0 commit comments

Comments
 (0)