Defining useful EJB3 entities and relationships

This topic is critical because a well-designed mapping prevents errors, saves a lot of time and has a big impact on performance.

Getting ready

In this section, we are going to present most of the Entities that we needed for the application. A couple of implementation techniques (from inheritance types to relationship cases) have been chosen here and highlighted for example purposes.

The How it works… section will explain why and how things are defined in the way they are and what were the thoughts that drove us toward the Entities' definitions we made.

How to do it...

The following steps will help you create Entities in the application:

  1. All the changes from this recipe are located in the new package

Get Spring MVC: Designing Real-World Web Applications 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.