From apache-cayenne
Edits Cayenne ORM DataMap and project descriptor XML files for granular model manipulation — entities, relationships, attributes, queries, stored procedures, and embeddables.
How this skill is triggered — by the user, by Claude, or both
Slash command
/apache-cayenne:cayenne-modelingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!--
Edit Cayenne DataMap (*.map.xml) and project descriptor (cayenne-*.xml) files directly. This is the default path for granular model changes — adding one entity, one relationship, one query. Use the Modeler GUI (cayenne-modeler skill) only for inherently visual work like reverse engineering.
Read these before making any edit — they describe the XML formats this skill operates on:
${CLAUDE_PLUGIN_ROOT}/references/project-layout.md — locate the project descriptor and DataMaps in the user's repo.${CLAUDE_PLUGIN_ROOT}/references/datamap-schema.md — every element shape for *.map.xml.${CLAUDE_PLUGIN_ROOT}/references/project-descriptor-schema.md — cayenne-*.xml shape.Follow project-layout.md. If the user has multiple Cayenne projects and the request is ambiguous, ask which one. Cache the answer for the rest of the session.
Decide whether the change belongs in a DataMap or the project descriptor (table at the end of project-layout.md):
*.map.xml).cayenne-*.xml).Apply the change following the schema in datamap-schema.md or project-descriptor-schema.md.
Element order matters. The DataMap schema requires this order inside <data-map>: <property>, <procedure>, <embeddable>, <db-entity>, <obj-entity>, <db-relationship>, <obj-relationship>, <query>, <cgen>, <dbImport>. Insert at the right place — don't append blindly.
Cross-link consistently.
<obj-entity> references a <db-entity> by dbEntityName="...". Make sure that DbEntity exists.<obj-attribute> references a DbAttribute by db-attribute-path="COLUMN_NAME". Make sure that column exists on the DbEntity (or on a related one if using a dotted path through a relationship).<obj-relationship> requires a backing <db-relationship> (or chain of them) via db-relationship-path. Never add an ObjRelationship without the DB-layer counterpart.<db-relationship> entries, one per direction. They are not auto-derived.Use the right type on attributes.
db-attribute type — JDBC type names: VARCHAR, INTEGER, BIGINT, DATE, TIMESTAMP, BOOLEAN, NUMERIC, BLOB, CLOB, VARBINARY, etc. VARCHAR/CHAR/VARBINARY also need length. NUMERIC/DECIMAL also need scale.obj-attribute type — Java FQN: java.lang.String, java.lang.Integer, java.util.Date, java.math.BigDecimal, byte[], etc. Use wrapper types (Integer, not int) for nullable columns.PK handling. PK columns get isPrimaryKey="true" isMandatory="true" on the DbAttribute. They are normally not mirrored as ObjAttributes — Cayenne handles them implicitly. Map a PK as an ObjAttribute only if the user wants a "meaningful PK" (visible on the Java side).
Preserve formatting. Match the indentation and quote style of the file (the standard Cayenne style uses tabs and double quotes, but follow what's actually in the file you're editing).
Changing defaultPackage on a DataMap. If the user asks to change the DataMap-level defaultPackage property, ask whether entity-level packages should be updated too. Otherwise, every existing obj-entity will keep its old package. Ask: "Do you also want me to update the className values on individual <obj-entity> elements that currently use the old package?" Update them only if the user confirms.
After writing the XML, mentally walk through:
obj-entity.dbEntityName resolve to an existing <db-entity>?obj-attribute.db-attribute-path resolve to a column on the right DbEntity?obj-relationship.db-relationship-path resolve to a chain of existing <db-relationship> entries?isMandatory="true" where the DB enforces NOT NULL?If anything fails, fix it before reporting done.
<cgen> block: suggest invoking the cayenne-cgen skill to regenerate Java classes. Mention which entities are affected.cayenne-cgen.cayenne-db-import. Do not try to script this via XML edits.Gametype/team1-style names, normalizing entity/attribute/relationship names across the model): hand off to cayenne-model-naming — it knows the naming conventions and the rename cross-reference checklist.cayenne-modeler skill. Otherwise do not.CayenneModeler watches the project XML files and automatically detects on-disk changes. When you edit a *.map.xml file directly, the Modeler will prompt the user to reload the project the next time they interact with it. There is no risk of the Modeler silently overwriting your edits. Do not warn the user that the Modeler may overwrite changes or tell them to close the Modeler before editing — that is incorrect and unnecessary.
_<Entity>.java superclass files. They are regenerated by cgen and your changes will be overwritten. Edit the user <Entity>.java subclass instead.obj-relationship without a db-relationship. Cayenne will validate-fail at runtime.int, long, boolean) as obj-attribute type for nullable columns. Primitives can't represent NULL. Use wrappers.cayenne-cgen's job — invoke that skill instead of calling the MCP tool directly here.mvn cayenne:cdbimport or any Maven/Gradle plugin goal. Those are explicitly out of scope for this plugin.npx claudepluginhub apache/cayenne --plugin apache-cayenneImports database schema metadata into a Cayenne DataMap (model/mapping only, not Java classes). Activates on requests to reverse engineer, import, or generate a DataMap from a database.
Generates ORM models, migrations, and relations for Prisma, TypeORM, Sequelize, SQLAlchemy, Django ORM, Drizzle from Postgres, MySQL schemas via introspection.
Designs JPA entities, repository patterns, query methods, JPQL, Flyway/Liquibase migrations, and N+1 avoidance for Spring Boot projects.