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 that can be used to handle inheritance. Finally, we showed you how to map enumerated types as well as create your own custom data type mapping.

In the next chapter, we will discuss more annotations to support more advanced mapping as well as the ones that affect database queries and the ones that affect the behaviour of an object. We'll also show you many Hibernate annotations that are not available in JPA.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.79.20