# mybatis/generator

A code generator for MyBatis.

Repository: https://github.com/mybatis/generator
Canonical: https://ross.abutalabs.com/products/generator
Homepage: http://www.mybatis.org/generator/
Language: Java
License: Apache-2.0
License Family: permissive
Topics: mybatis, sql-generation, java-8, kotlin, code-generator, mybatis-generator
Last push: 2026-08-26T19:58:18+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 46, longevity 100
- inputs: {"age_days": 4952, "days_push": 7, "days_rel": 147, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5313, forks 2474 (observed 2026-08-28T04:09:15.469577+00:00)

## What it is
MyBatis Generator (MBG) is a code generator that introspects database tables and generates Java or Kotlin model classes and MyBatis mapper code for CRUD access. It runs from the command line, as a Maven plugin, Ant task, or Eclipse plugin.

## Use cases
- generate mybatis mapper and model classes from database tables
- scaffold crud code for a java project
- generate kotlin data classes from a database schema
- avoid writing boilerplate mybatis xml configuration
- generate java records matching table structure

## When to choose
- you use MyBatis and want to eliminate boilerplate for simple CRUD operations
- you want generated code based on an existing database schema
- you prefer annotation-based or MyBatis Dynamic SQL code over hand-written XML

## When to avoid
- you need complex join queries or stored procedures - MBG only covers simple CRUD
- you use an ORM other than MyBatis
- you want a full runtime ORM framework rather than generated code

## Facets
- artifact type: library
- maturity: stable
- function: orm, database, developer-tools, cli, plugin-system
- domain: databases, developer-tools, backend, web-development
- platform: jvm, cli, editor-plugin
- tags: mybatis, code-generation, crud, kotlin, maven-plugin, eclipse-plugin, boilerplate

## Member repositories
- mybatis/generator (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:15.469577+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:58:58.222241+00:00, confidence not recorded.
  - readme: https://github.com/mybatis/generator (fetched 2026-08-28T04:09:15.469577+00:00, sha 1f40e27ecc4a)
  - homepage: http://www.mybatis.org/generator/ (fetched 2026-08-29T08:53:42.238765+00:00, sha dd34de4e9a2a)
  - site_page: https://mybatis.org/generator/quickstart.html (fetched 2026-08-29T08:53:42.248616+00:00, sha ec9a8886bfdc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
