Enterprise Java Development@TOPIC@

Chapter 64. Inheritance Strategy:Table per Concrete Class

64.1. Table per Concrete Class Strategy Overview
64.2. Table per Concrete Class Example Database Schema
64.3. Table per Concrete Class Example Java Mapping
64.4. Table per Concrete Class Example Usage
64.5. Summary

  • Advantages

    • May have constrained columns

    • No joins when accessing a single concrete type

  • Disadvantages

    • Not normalized

    • Redundant columns in each concrete child table

    • More work required to query across tables

      • Requires use of SQL "UNION"

    • Least desirable from a performance/portability standpoint

  • More suitable for ...

    • Sub-types not needed to be manipulated with sibling other sub-types


  • Table for each concrete class

  • No separate table for parent class

  • Parent columns repeated in concrete sub-class tables

  • * his particular example uses SEQUENCE for primary key generation


  • Parent defines default mapping for all derived types, including PK generation

  • Using a common SEQUENCE allows sub-classes to have unique PKs across all tables


  • Subclasses name their specific entity class table


  • Rows for entities placed into separate tables


  • Query through parent type causes SQL "UNION ALL" of each concrete sub-class table


  • Table per concrete class

  • No unused columns

  • Parent columns repeated in each sub-class table