EE5 Travel Center Entities Project

Creating The Persistence Unit and Entity Classes

This package contains Java Persistence Architecture entity classes, and a corresponding persistence unit definition, for the tables found in the Travel Center example database that ships with Creator 2 Update 1, using JavaDB. It was built with NetbBeans 5.5 Beta 2, by using the following steps:

At this point, we have a set of entity classes that correspond to each of the tables in the Travel Center database. It would be possible to customize things along the way, or to add additional custom methods -- but those can be left for later development.

This library of entity classes can now be used in a variety of different ways. Additional projects will demonstrate using these classes:

To achieve these objectives, a business logic bean Logic.java was hand created in the ee5travel.logic package. This allows the development of a single copy of the actual modification logic, which can then be reused in the above scenarios.

Defining a JDBC Data Source In Glassfish

As supplied, the persistence unit in this project specifies that a JDBC data source named "jdbc/travel" be used to access the data. Before you can deploy an application that uses these classes, then, you must do a one-time configuration of this data source in the Glassfish instance you will be deploying to. This configuration is accomplished using the administration console for the server, as follows: