Enterprise Java Development@TOPIC@

Part V. Java Persistence API: Relationship Exercise

Mapping Entity Relationships to the Database

2019-08-22 07:10 EST

Table of Contents

Purpose
34. JPA Entity Exercise Setup
34.1. Setup Maven Project
35. Mapping One-to-One Relationships
35.1. Setup
35.2. One-to-One Uni-directional Relationships
35.2.1. One-to-One Uni-directional Using a Foreign Key
35.2.2. One-to-One Uni-directional Using a Join Table
35.2.3. One-to-One Uni-directional Using a Primary Key Join
35.2.4. One-to-One Uni-directional Using MapsId
35.2.5. One-to-One Uni-directional Using Composite Primary/Foreign Keys
35.3. Mapping One-to-One Bi-directional Relationships
35.3.1. One-to-One Bi-directional Joined By Primary Key
35.3.2. One-to-One Bi-directional 0..1 Owner Relationship
35.3.3. One-to-One Bi-directional 0..1 Inverse Relationship
35.4. One-to-One EntityManager Automated Actions
35.4.1. One-to-One Using Cascades From Owner
35.4.2. One-to-One Using Cascades From Inverse
35.4.3. One-to-One Using Orphan Removal
35.5. Summary
36. Mapping One-to-Many Uni-directional Relationships
36.1. Setup
36.2. One-to-Many Uni-directional
36.2.1. One-to-Many Uni-directional with Join Table
36.2.2. One-to-Many Uni-directional using Foreign Key Join (from Child Table)
36.2.3. One-to-Many Uni-directional Mapping of Simple Types using ElementCollection
36.2.4. One-to-Many Uni-directional Mapping of Embeddable Type using ElementCollection
36.3. One-to-Many Provider Actions
36.3.1. One-to-Many Orphan Removal
36.4. Summary
37. JPA Collections
37.1. Setup
37.2. Entity Identity
37.2.1. Instance Id
37.2.2. Primary Key Id
37.2.3. Switching Ids
37.2.4. Business Id
37.3. Collection Ordering
37.3.1. Ordered Collections
37.4. Collection Interfaces
37.4.1. Using Maps with Collections
37.5. Summary
38. Mapping Many-to-One, Uni-directional Relationships
38.1. Setup
38.2. Many-to-One Uni-directional
38.2.1. Many-to-One Uni-directional Using a Foreign Key
38.2.2. Many-to-One Uni-directional Using a Compound Foreign Key
38.2.3. Many-to-One Uni-directional Using a MapsId
38.3. Summary
39. Mapping One-to-Many/Many-to-One Bi-directional Relationships
39.1. Setup
39.2. One-to-Many Bi-directional using Foreign Key Join
39.3. One-to-Many Bi-directional using Join Table
39.4. One-to-Many Bi-directional using Derived Composite Primary
39.5. Summary
40. Mapping Many-to-Many Relationships
40.1. Setup
40.2. Many-to-Many Uni-directional
40.3. Many-to-Many Bi-directional
40.4. Summary