CHAPTER 3

image

Component Mapping

Hibernate makes it easy to employ a fine-grained domain model so you can have more classes than tables. In other words, you can map a single record in a table to more than one class by having one Entity class type; the others should be Value class types.

Hibernate classifies objects as either entity object types or value object types. An entity object type is an independent entity and has its own life cycle. It has its own primary key and hence its own database identity. A value object type doesn’t have an identifier. A value object type belongs to an entity and is bound by the life cycle of the owning entity instance. ...

Get Hibernate Recipes: A Problem-Solution Approach, Second Edition 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.