Enterprise Java Development@TOPIC@

Part V. Java Persistence API: Relationship Exercise

Mapping Entity Relationships to the Database

2015-11-18 01:59 EST

Table of Contents

Purpose
35. JPA Entity Exercise Setup
35.1. Setup Maven Project
36. Mapping One-to-One Relationships
36.1. Setup
36.2. One-to-One Uni-directional Relationships
36.2.1. One-to-One Uni-directional Using a Foreign Key
36.2.2. One-to-One Uni-directional Using a Join Table
36.2.3. One-to-One Uni-directional Using a Primary Key Join
36.2.4. One-to-One Uni-directional Using MapsId
36.2.5. One-to-One Uni-directional Using Composite Primary/Foreign Keys
36.3. Mapping One-to-One Bi-directional Relationships
36.3.1. One-to-One Bi-directional Joined By Primary Key
36.3.2. One-to-One Bi-directional 0..1 Owner Relationship
36.3.3. One-to-One Bi-directional 0..1 Inverse Relationship
36.4. One-to-One EntityManager Automated Actions
36.4.1. One-to-One Using Cascades From Owner
36.4.2. One-to-One Using Cascades From Inverse
36.4.3. One-to-One Using Orphan Removal
36.5. Summary
37. Mapping One-to-Many Uni-directional Relationships
37.1. Setup
37.2. One-to-Many Uni-directional
37.2.1. One-to-Many Uni-directional with Join Table
37.2.2. One-to-Many Uni-directional using Foreign Key Join (from Child Table)
37.2.3. One-to-Many Uni-directional Mapping of Simple Types using ElementCollection
37.2.4. One-to-Many Uni-directional Mapping of Embeddable Type using ElementCollection
37.3. One-to-Many Provider Actions
37.3.1. One-to-Many Orphan Removal
37.4. Summary
38. JPA Collections
38.1. Setup
38.2. Entity Identity
38.2.1. Instance Id
38.2.2. Primary Key Id
38.2.3. Switching Ids
38.2.4. Business Id
38.3. Collection Ordering
38.3.1. Ordered Collections
38.4. Collection Interfaces
38.4.1. Using Maps with Collections
38.5. Summary
39. Mapping Many-to-One, Uni-directional Relationships
39.1. Setup
39.2. Many-to-One Uni-directional
39.2.1. Many-to-One Uni-directional Using a Foreign Key
39.2.2. Many-to-One Uni-directional Using a Compound Foreign Key
39.2.3. Many-to-One Uni-directional Using a MapsId
39.3. Summary
40. Mapping One-to-Many/Many-to-One Bi-directional Relationships
40.1. Setup
40.2. One-to-Many Bi-directional using Foreign Key Join
40.3. One-to-Many Bi-directional using Join Table
40.4. One-to-Many Bi-directional using Derived Composite Primary
40.5. Summary
41. Mapping Many-to-Many Relationships
41.1. Setup
41.2. Many-to-Many Uni-directional
41.3. Many-to-Many Bi-directional
41.4. Summary