Creating the Demonstration classes

The City entity and its supporting classes will provide methods which will illustrate the use of transactions. A session facade is created for the class along with a servlet and a PopulationManager class. This class along with the session facade is where we will find most of the transactions used in this chapter.

Getting ready

In this recipe, we will create a series of classes to support the illustration of transaction processing. These classes include:

  • City An entity class representing a city
  • CityFacade A facade class supporting the City entity
  • AbstractFacade The base class for CityFacade
  • PopulationServlet A servlet to drive the application

Subsequent recipes will build upon these classes.

How to do it...

Create a new ...

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.