SKILL

mybatis-patterns

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.

Target: Databases. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • 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

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
affaan-m/ECC
Source file
pi/core/skills/mybatis-patterns/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.142Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.