# Springboot Jpa Entity Class Conventions

> 为实体类设计设定标准，包括用于数据库交互的注解、ID 生成策略和关系配置。

- Skill: `liaosw97/springboot-jpa-entity-class-conventions` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add liaosw97/springboot-jpa-entity-class-conventions`
- Raw SKILL.md: https://api.skillmd.com/api/skills/liaosw97/springboot-jpa-entity-class-conventions/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: liaosw97 (https://skillmd.com/u/liaosw97)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/liaosw97/springboot-jpa-entity-class-conventions

---


- 必须使用 @Entity 注解实体类。
- 必须使用 @Data (来自 Lombok) 注解实体类，除非在提示中另有说明。
- 必须使用 @Id 和 @GeneratedValue(strategy=GenerationType.IDENTITY) 注解实体 ID。
- 必须对关系使用 FetchType.LAZY，除非在提示中另有说明。
- 根据最佳实践正确注解实体属性，例如 @Size, @NotEmpty, @Email 等。

