tree: 61a100e259efc79ce57e83ca6b7bd497627d3c0e [search]
  1. .claude-plugin/
  2. references/
  3. skills/
  4. README.md
ai-plugin/README.md

apache-cayenne-5 — Claude Code plugin

Apache Cayenne ORM workflows for Claude Code.

This plugin teaches Claude how to:

  • Edit Cayenne DataMap (*.map.xml) and project descriptor (cayenne-*.xml) files a-la-carte (add entities, relationships, queries, embeddables). The DB layer (DbEntity / DbAttribute / DbRelationship) is left to DB import, and is only edited by hand if you explicitly say you don't use DB import.
  • Reverse-engineer a database schema into a DataMap by driving CayenneModeler.
  • Polish the reverse-engineered Object-layer names (entities, attributes, relationships) into idiomatic Java, fixing the few cases the deterministic name generator can't.
  • Regenerate Java entity classes from a DataMap.
  • Run a full DB sync — import, name cleanup, and class regeneration — as a single end-to-end workflow.
  • Bootstrap CayenneRuntime in a Java application and write ObjectSelect / SQLSelect queries.

The plugin assumes downstream users of Cayenne writing their own Java apps. It does not cover contributor workflows for hacking on Cayenne itself.

Install

Cayenne 5.0. The plugin is versioned with Cayenne: apache-cayenne-5 is the plugin for the 5.0 release line, and apache-cayenne-6 from the same marketplace is for Cayenne 6.0. There is no unversioned plugin; pick the one matching the project's Cayenne major version. The MCP server ships with Cayenne 5.0. Skills that depend on it (cayenne-cgen, cayenne-modeler, cayenne-db-import, cayenne-full-db-sync) will not work against earlier Cayenne versions. The XML-editing, runtime, and query skills also target 5.0 idioms — for older Cayenne, this plugin is not the right tool.

The plugin is distributed from the Apache Cayenne GitHub repository: https://github.com/apache/cayenne. Inside Claude Code:

# register the "marketplace"
/plugin marketplace add apache/cayenne

# install the plugin for Cayenne 5.0. Note the "-5" suffix: "apache-cayenne-6"
# is for Cayenne 6.0, and its skills teach API that doesn't exist in 5.0
/plugin install apache-cayenne-5@apache-cayenne

# Install the MCP server (requires a local CayenneModeler install)
claude mcp add cayenne --scope user -- java -jar /path/to/CayenneMCPServer.jar

Full MCP setup instructions: https://cayenne.apache.org/docs/5.0/cayenne-guide/installing-the-cayenne-mcp-server/

That‘s it. The skills detect the MCP server at runtime; if it isn’t connected they point back at this README instead of falling back to Maven or Gradle goals.

What's in here

ai-plugin/
├── .claude-plugin/plugin.json   # manifest
├── README.md                    # this file
├── skills/                      # auto-triggering workflows
│   ├── cayenne-modeling/        # edit *.map.xml and cayenne-*.xml
│   ├── cayenne-db-import/       # import a DB schema into the DataMap (model only)
│   ├── cayenne-model-naming/    # polish Obj-layer names after import / on request
│   ├── cayenne-cgen/            # regenerate Java classes via MCP
│   ├── cayenne-full-db-sync/    # orchestrate import → name cleanup → cgen
│   ├── cayenne-modeler/         # open the GUI on a project
│   ├── cayenne-runtime/         # bootstrap CayenneRuntime in an app
│   └── cayenne-query/           # write ObjectSelect / SQLSelect queries
└── references/                  # source-of-truth docs loaded by skills
    ├── project-layout.md
    ├── datamap-schema.md
    ├── project-descriptor-schema.md
    ├── dbimport-config.md
    ├── model-naming-conventions.md
    ├── model-naming-rename-safety.md
    ├── cgen-config.md
    ├── runtime-api.md
    ├── query-api.md
    └── mcp-tools.md

Each skill is a thin trigger that loads the right reference docs and walks Claude through the workflow.

ORM workflows go through:

  1. Direct XML edits — primary path for a-la-carte Object-layer model changes (and DB-layer changes only when you explicitly don't use DB import).
  2. MCP dbimport_run — the DB layer of the model, of any size, imported from the database.
  3. MCP cgen_run — class generation.
  4. MCP open_project → CayenneModeler GUI — upgrading mappings saved by an older Cayenne version, first-time DB connection setup, and visual editing.

and will NOT use Maven or Gradle plugins