O'Reilly logo

Spring Roo 1.1 Cookbook by Ashish Sarin

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

Creating a many-to-one (or one-to-one) relationship between entities

In real-world applications, domain entities have relationships between them. In this section, we look at how Roo simplifies creating a many-to-one (or one-to-one) relationship between JPA entities.

The following figure shows the relationship between the FLIGHT_TBL and FLIGHT_DESC_TBL tables, which we will use as a reference to model our many-to-orelationship:

Creating a many-to-one (or one-to-one) relationship between entities

In the given figure, the FLIGHT_TBL table contains scheduled flight details and the FLIGHT_DESC_TBL table contains details of all the flights that an airline offers. Each record in the FLIGHT_TBL table refers to exactly one ...

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