O'Reilly logo

Hibernate Recipes: A Problem-Solution Approach by GARY MAK, SRINIVAS GURUZU

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 and 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required