Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions document/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export default defineAdditionalConfig({
{ text: "DTO Lanauge", link: "dto-language" },
],
},
{
text: "Reference",
base: "/reference/",
link: "feature-inspection",
},
],
},
"/reference/": {
Expand Down
27 changes: 21 additions & 6 deletions document/en/reference/feature-generate-entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,35 @@ JimmerBuddy can generate entity classes from the databases or ddl files.
2. Switch to `Database` tab.
3. Click `+` button to add a database or ddl file.

![20250524204214](https://s2.loli.net/2025/05/24/p6r1P3MADVmzhkJ.png)
![20250525161526](https://s2.loli.net/2025/05/25/6LqW4NlZKJhR9uM.png)

4. Input some information about the database or ddl file.

![20250524204250](https://s2.loli.net/2025/05/24/zeITHF8rkLGWx3t.png)
![20250524204416](https://s2.loli.net/2025/05/24/RGaKgpvNbJu1MdE.png)
![20250525162253](https://s2.loli.net/2025/05/25/C1REKkceOMHq2AP.png)

5. Click `OK` button to save the configuration.

![20250524204456](https://s2.loli.net/2025/05/24/1MEC3GrcBz4P6Vn.png)
![20250525162311](https://s2.loli.net/2025/05/25/N64wXcrDvsyY3qP.png)

6. Select the database or ddl file then right click it.
7. Select `Generate` from the context menu.
8. In the popup dialog, input the relative path and package name.

![](https://s2.loli.net/2025/05/24/1z3CVWorRKgq9hS.png)
![20250525162405](https://s2.loli.net/2025/05/25/Bl3cTdeaEtIC49s.png)

8. Click `OK` button to generate the entity classes.
9. Click `OK` button to generate the entity classes.

![20250525162454](https://s2.loli.net/2025/05/25/v85Khz2HL7Y6FQE.png)

## Configuration Entity Comments

Go to the `File and Code Templates` settings page and select `Jimmer`.

![20250525162739](https://s2.loli.net/2025/05/25/c6bPYIXEo9wvutA.png)

## Notes

- The generated entity classes will overwrite the existing ones with the same name.
- Tables without a primary key will not be generated.
- The `BaseEntity` will only be generated if the public fields are present in all tables.
- Join tables will only be treated as such if they have no primary key and only two fields.
5 changes: 5 additions & 0 deletions document/zh/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export default defineAdditionalConfig({
{ text: "可视化创建", link: "visualization-create" },
],
},
{
text: "参考",
base: "/zh/reference/",
link: "feature-inspection",
},
],
},
},
Expand Down
29 changes: 22 additions & 7 deletions document/zh/reference/feature-generate-entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,37 @@ JimmerBuddy 可以从数据库或 ddl 文件生成实体类。

1. 打开 JimmerBuddy 工具窗口。
2. 切换到 `Database` 选项卡。
3. 点击 `+` 按钮添加数据库或 ddl 文件。

![20250524204214](https://s2.loli.net/2025/05/24/p6r1P3MADVmzhkJ.png)
![20250525161526](https://s2.loli.net/2025/05/25/6LqW4NlZKJhR9uM.png)

3. 点击 `+` 按钮添加数据库或 ddl 文件。
4. 输入一些关于数据库或 ddl 文件的信息。

![20250524204250](https://s2.loli.net/2025/05/24/zeITHF8rkLGWx3t.png)
![20250524204416](https://s2.loli.net/2025/05/24/RGaKgpvNbJu1MdE.png)
![20250525162253](https://s2.loli.net/2025/05/25/C1REKkceOMHq2AP.png)

5. 点击 `OK` 按钮保存配置。

![20250524204456](https://s2.loli.net/2025/05/24/1MEC3GrcBz4P6Vn.png)
![20250525162311](https://s2.loli.net/2025/05/25/N64wXcrDvsyY3qP.png)

6. 选择数据库或 ddl 文件,然后右键单击它。
7. 从上下文菜单中选择 `Generate`。
8. 在弹出的对话框中,输入相对路径和包名。

![20250525162405](https://s2.loli.net/2025/05/25/Bl3cTdeaEtIC49s.png)

9. 点击 `OK` 按钮生成实体类。

![20250525162454](https://s2.loli.net/2025/05/25/v85Khz2HL7Y6FQE.png)

## 配置实体注释

进入到 `File and Code Templates` 设置页面,选择 `Jimmer`。

![20250525162739](https://s2.loli.net/2025/05/25/c6bPYIXEo9wvutA.png)

![](https://s2.loli.net/2025/05/24/1z3CVWorRKgq9hS.png)
## 注意事项

8. 点击 `OK` 按钮生成实体类。
- 生成的实体类会覆盖同名的实体类。
- 没有主键的表不会生成。
- `BaseEntity`实体只有当公共字段在所有表中都有时才会生成。
- 中间表只有没有主键并只有两个字段时才会被当成中间表处理。
2 changes: 1 addition & 1 deletion document/zh/reference/feature-project-wizard.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 项目向导

Go to `New Project` and select `Jimmer`.
转到`New Project`并选择`Jimmer`

![20250524205732](https://s2.loli.net/2025/05/24/YigsuCNjEb7rU6Q.png)