jpa-patterns
面向Spring Boot中实体设计、关系、查询优化、事务、审计、索引、分页和连接池的JPA/Hibernate模式。
机器翻译查看英文原文
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
适用对象:设计与内容创作。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- JPA/Hibernate Patterns
- When to Activate
- Entity Design
- Relationships and N+1 Prevention
- Repository Patterns
- Transactions
- Pagination
- Indexing and Performance
Use for data modeling, repositories, and performance tuning in Spring Boot. Designing JPA entities and table mappings Defining relationships (@OneToMany, @ManyToOne, @ManyToMany) Optimizing queries (N+1 prevention, fetch strategies, projections) Configuring transactions, auditing, or soft deletes Setting up pagination, sorting, or custom repository methods Tuning connection pooling (HikariCP) or second-level caching Enable auditing: Default to lazy loading; use JOIN FETCH in queries when needed Avoid EAGER on collections; use DTO projections for read paths Note: DISTINCT is required when fetch-joining a one-to-many collection — without it, the root entity is duplicated once per child row in the result set. For single-result queries (findById) the duplication is harmless, but for list queries it produces duplicate root objects. Hibernate 6+ applies de-duplication automatically in some cases, but explicit DISTINCT keeps behavior portable and clear. Use projections for lightweight queries: Annotate service methods with @Transactional Use @Transactional(readOnly = true) for read paths to optimize Choose propagation carefully; avoid long-running transactions For cursor-like pagination,
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- affaan-m/ECC
- 源文件
- .kiro/skills/jpa-patterns/SKILL.md
- 固定版本
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:48.611Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。