advancedEntity Mapping — @Entity, @Id, Inheritance & Composite Keys
What are the three JPA inheritance mapping strategies, and what's the core tradeoff between them?
Single Table (one table, a discriminator column, nullable columns for subtype-specific fields — fastest, no joins, but sparse columns), Joined (one table per subtype joined back to a base table — normalized, but requires a join to reconstruct a full entity), and Table Per Class (each subtype fully independent — no joins for one subtype, but polymorphic queries across all subtypes need a UNION).
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.
What are the three JPA inheritance mapping strategies, and what's the core tradeoff between them?