Enterprise Java Development@TOPIC@

Chapter 65. Inheritance Strategy:Join

65.1. Join Strategy Overview
65.2. Join Example Database Schema
65.3. Join Example Java Mapping
65.4. Join Example Usage (Persist)
65.5. Summary

  • Advantages

    • Can be normalized

    • Permits constraints to be defined

  • Disadvantages

    • Requires access to multiple tables when using (insert, select, update, and delete) an entity

  • More suitable for sub-classes that...

    • Have many unique properties

    • Require database constraints

    • Are queried for across sibling sub-types


  • Table for each entity class is created

  • Each table has a primary key

  • Sub-class tables use a primary key join with parent class


  • Parent defines default mapping for all derived types

  • Parent entity class table also defined


  • Sub-classes define their entity-specific tables


  • Each persist() must insert into concrete class table and parent class table(s)


  • Parent class table joined with each sub-class table during query of parent type


  • Entities span multiple tables