7.4. Summary

In this chapter, you learned how to map more complex entity associations. Many of the techniques we've shown are rarely needed and may be unnecessary if you can simplify the relationships between your classes. In particular, many-to-many entity associations are often best represented as two one-to-many associations to an intermediate entity class, or with a collection of components.

Table 7.1 shows a summary you can use to compare native Hibernate features and Java Persistence.

Table 7-1. Hibernate and JPA comparison chart for chapter 7
Hibernate CoreJava Persistence and EJB 3.0
Hibernate supports key generation for shared primary key one-to-one association mappings.Standardized one-to-one mapping is supported. Automatic shared primary ...

Get Java Persistence with 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.