Populating the Patient and Medication tables

In this recipe, we will learn how to create and populate the Patient and a Medication table. These tables will be used for the other recipes in this chapter. This approach means you do not have to import or otherwise use an existing database. The process of creating these tables is facilitated through several helper methods. Upon completion of this recipe, you will have the base for learning how to use JPQL as illustrated in the remaining recipes.

Getting ready

The process of creating this application consists of:

  1. Creating five classes
    • Patient An entity representing a patient
    • Medication An entity representing the medications used by a patient
    • AbstractFacade A base class used by the next two classes
    • PatientFacade ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.