Inheritance Mapping Strategies

Mapping a subtype hierarchy onto tables — single table, class table (joined), concrete table per class — and deciding whether the hierarchy should exist at all. Use when an @Inheritance strategy is being chosen, when a single-table mapping is forcing every subtype's columns to be nullable, when a joined mapping's polymorphic query joins six tables to render a list, when adding a subtype requires a migration, when a discriminator column has drifted from the class names, when polymorphic queries are slow or return the wrong rows, when a hierarchy exists only to share three fields, or when composition would serve better than subtyping. Does not cover associations, identity and value mapping (orm-structural-mapping), where the mapping instructions live (metadata-mapping), the runtime fetch behaviour (orm-behavioral-patterns), or the domain question of whether subtypes model the business correctly (domain-logic-organization).

robsonkades Updated

File contents

robsonkades/agent-skills/tree/main/skills/inheritance-mapping-strategies commit 73e4ca0f62

Frequently asked questions

npx skillmds@latest add robsonkades/inheritance-mapping-strategies