O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

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

Mapping object associations

So far in this chapter, you've learned about mapping components. A component is a property of a persistent class represented as another persistent class, which is stored with its owner class in one table. Instead of persisting associated classes in one table, each class may be persisted in its own table. This approach is the subject of this next section. We'll begin by looking at different types of object associations and how they are represented in the Java object model.

Suppose there are two persistent classes called A and B. The relationship of A and B is called one-to-one if any instance of A is associated with only a single instance of B, and no more. A one-to-one association is always presented as an instance ...

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