Part 2. Mapping strategies

 

This part of the book is all about ORM, from classes and properties to tables and columns. The knowledge you will gain here is essential, whether you work with Hibernate or Spring Data JPA as your persistence framework. Chapter 5 starts with regular class and property mappings and explains how you can map fine-grained Java domain models. Next, in chapter 6, you’ll see how to map basic properties and embeddable components, and how to control mapping between Java and SQL types. In chapter 7, you’ll map inheritance hierarchies of entities to the database using four basic inheritance-mapping strategies; you’ll also map polymorphic associations. Chapter 8 is all about mapping collections and entity associations: you’ll map persistent collections, collections of basic and embeddable types, and simple many-to-one and one-to-many entity associations. Chapter 9 dives deeper with advanced entity association mappings like mapping one-to-one entity associations, one-to-many mapping options, and many-to-many and ternary entity relationships.

After reading this part of the book, you’ll be ready to create even the most complex mappings quickly and with the right strategy. You’ll understand how the problem of inheritance mapping can be solved and how to map collections and associations.