Summary

This chapter presented the foundation of object-relational mapping. We discussed the definition of an owner entity. We also defined value types and showed you how to map these properly in the entity table or a separate table. You also learned the concepts around ID generation and how to N generate ID using JPA or Hibernate strategies. You combined the value types and ID generation to discuss composite IDs.

Furthermore, we discussed associations and their cardinalities, one-to-one, many-to-one, and many-to-many, and showed you how to map self-referencing tables. Later we showed how to instruct Hibernate to perform cascade operations on associated entities.

We also covered inheritance and how Hibernate handles them. We showed you various strategies ...

Get Mastering Hibernate now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.