后端与数据库

mybatis-patterns

affaan-m/ecc

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.

  • 1206 次安装
  • 29.2万 星标
  • 收录于

安装命令

npx skills add https://github.com/affaan-m/ecc --skill mybatis-patterns

SKILL.md

MyBatis Patterns

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.

When to Activate

  • 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

How It Works