mybatis-patterns
MyBatis 和 MyBatis-Spring 模式,涵盖 mapper 设计、XML 与注解 SQL、结果映射、动态 SQL 安全性、事务、批处理、分页和查询性能。适用于使用 MyBatis、Spring Boot、MyBatis-Spring 或基于 MyBatis 的遗留应用构建或审查 Java 持久化代码时。
机器翻译查看英文原文
MyBatis and MyBatis-Spring patterns for mapper design, XML and annotation SQL, result mapping, dynamic SQL safety, transactions, batching, pagination, and query performance. Use when building or reviewing Java persistence code with MyBatis, Spring Boot, MyBatis-Spring, or MyBatis-based legacy applications.
适用对象:数据库。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- MyBatis Patterns
- When to Activate
- How It Works
- Examples
- Parameter Binding and SQL Safety
- XML, Result Types, and Result Maps
- Dynamic SQL
- Transactions and Sessions
Use MyBatis when SQL control and explicit mappings matter. Keep SQL readable, make mapper contracts small, and put business transactions in the service layer. Pair this skill with springboot-patterns for application structure, database-migrations for schema changes, postgres-patterns or mysql-patterns for engine-specific SQL, and security-review for untrusted input and access-control concerns. Adding or reviewing MyBatis mapper interfaces or XML files Choosing between XML mappers, annotation mappers, and generated SQL Designing resultMap mappings, joins, nested collections, or projections Reviewing dynamic SQL, parameter binding, pagination, or batch writes Debugging N+1 queries, slow statements, connection use, or transaction bugs Integrating MyBatis-Spring into Spring Boot or an XML-first legacy application Use a thin mapper for persistence operations and keep business rules in a service. A typical flow is: Register mappers once, either with @Mapper on each interface or with @MapperScan for a package. Do not mix registration approaches casually. Keep the XML namespace equal to the mapper interface's fully qualified name. Give each statement a stable, descriptive id; treat mapper
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- affaan-m/ECC
- 源文件
- pi/core/skills/mybatis-patterns/SKILL.md
- 固定版本
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:43.142Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。