MyBatis SQL mappers
Writes MyBatis mappers, dynamic SQL, transactions and paging safely, so Java data access stays fast.
Claude's review
8/10 MyBatis patterns with strong SQL safety, empty list and transaction guidance
We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.
In detail
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.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: mybatis-patterns
description: 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.
metadata:
origin: ECC
---
# 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
Use a thin mapper for persistence operations and keep business rules in a
service. A typical flow is:
```text
Controller / batch job -> Service (@Transactional) -> Mapper -> Database
```
- 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 methods as a
persistence API that can be tested independently.
- Return a domain DTO or projection for read paths instead of exposing a large
...From affaan-m's repository, MIT licence.
Related skills
-
Checked
PostgreSQL schema explorer
Explores an unfamiliar PostgreSQL database read only before writing SQL, so answers about your data are right.
7/101 credit -
Checked
HTTP API design review
Designs or reviews HTTP endpoints, auth, pagination and versioning, so API changes do not break your clients.
7/101 credit -
Checked
Firebase Data Connect
Builds and deploys Firebase Data Connect backends on PostgreSQL with secure queries and type safe SDKs.
7/101 credit -
Checked
App performance tuning
Measures first, then fixes slow pages, Core Web Vitals and N+1 database queries across your whole app.
7/101 credit -
Checked
Safe Postgres migrations
Plans and tests PostgreSQL schema changes with lock levels in mind, so live tables change without downtime.
8/101 credit -
Checked
Supabase auth and database
Builds with Supabase auth, database, storage and edge functions while avoiding common security traps.
8/101 credit