This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 67a22bd1587ffb930216c9bafb32e6d3a8070242 Author: Andrus Adamchik <[email protected]> AuthorDate: Mon Jul 20 15:52:21 2026 +0200 CAY-2980 Improve model name generation clarifying special identifiers rules --- ai-plugin/references/model-naming-conventions.md | 7 +++++-- ai-plugin/skills/cayenne-model-naming/SKILL.md | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ai-plugin/references/model-naming-conventions.md b/ai-plugin/references/model-naming-conventions.md index 94df7ea39..32aec7471 100644 --- a/ai-plugin/references/model-naming-conventions.md +++ b/ai-plugin/references/model-naming-conventions.md @@ -143,8 +143,11 @@ The three cases above don't exhaust the ways a purely mechanical transliteration you spot a name where a human reading the underlying DB name would obviously do better, and the fix is defensible (not a guess), apply the same conservative treatment. Some more examples: -- **Reserved words / illegal identifiers** the generator passed through — a column literally named - `class`, `package`, `default`, or one starting with a digit needs a legal Java name. +- **Genuinely illegal identifiers** the generator passed through — a name starting with a digit, or + literally `class`, whose getter `getClass()` collides with the final `Object.getClass()`. Java + *keywords* are **not** a problem — `default`, `package`, `return` and the like compile fine, since + class generation prefixes the field/parameter name with `_` and embeds the capitalized name in the + accessors (`getDefault()` / `setDefault()`). Leave keyword-named properties alone. - **Lost acronym casing** — `HTTPURL` → `Gametype`-style collapse loses the acronym; `httpUrl` / `url` may read better than `httpurl`. - **Plural table → singular entity** — a `CUSTOMERS` table yields `Customers`; an entity is a single diff --git a/ai-plugin/skills/cayenne-model-naming/SKILL.md b/ai-plugin/skills/cayenne-model-naming/SKILL.md index b86aa44d7..44b1af552 100644 --- a/ai-plugin/skills/cayenne-model-naming/SKILL.md +++ b/ai-plugin/skills/cayenne-model-naming/SKILL.md @@ -95,9 +95,11 @@ correct — leave them.** Flag only the cases the deterministic generator can't names (`customer`, `orders`); a relationship is a role/property, and the prefix is noise there. **Leave the entity names alone** — the prefix on classes is the user's choice, and renaming entities regenerates classes. -4. **Other clear, defensible improvements** — reserved words, lost acronym casing, obvious cryptic - abbreviations applied consistently, plural-table-to-singular-entity. Conservative by default; when - unsure, leave the baseline name and ask. +4. **Other clear, defensible improvements** — illegal identifiers (digit-leading names, or `class`, + whose getter would clash with `Object.getClass()` — Java keywords are fine, cgen escapes them), + lost acronym casing, obvious cryptic abbreviations applied consistently, + plural-table-to-singular-entity. Conservative by default; when unsure, leave the baseline name + and ask. Relationship cleanup is anchored on the **DbRelationship** — it's the first-class citizen, since every FK has one whether or not an ObjRelationship was generated on top. The rules above (run-together,
