Chapter 3. Component Mapping
Hibernate makes it easy to employ a fine-grained domain model. That means you can have more classes than tables. In other words, you can map a single record in a table to more than one class. You do so by having one class of type Entity a
nd the others of Value
types.
Hibernate classifies objects as either entity
type or value
type. An object of entity
type is an independent entity and has its own lifecycle. It has its own primary key and hence its own database identity. A value
type doesn't have an identifier. A value
type belongs to an entity. Value
type objects are bound by the lifecycle of the owning entity instance. When a value
type is persisted, the value
type's state is persisted in the owning entity's table ...
Get Hibernate Recipes: A Problem-Solution Approach 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.