Book Image

EJB 3 Developer Guide

By : Michael Sikora
Book Image

EJB 3 Developer Guide

By: Michael Sikora

Overview of this book

Table of Contents (18 chapters)
EJB 3 Developer Guide
Credits
About the Author
About the Reviewers
Preface
Annotations and Their Corresponding Packages

Packaging and Deploying Entities


As we have introduced a number of new source code artifacts that were not present in the previous chapter on session beans, the packaging process will be a little different. First we look at the program directory structure for our sample application.

The Program Directory Structure

Below is the program directory structure for the BankClient application which invokes the BankServiceBean in order to add the Customer entity to the database.

There are a couple of differences in the directory structure from the one described in the previous chapter. We have added an entity subdirectory; this contains the entity source code, Customer.java. We have also added a config subdirectory containing the manifest.mf and persistence.xml files.

Building the Application

Because we are persisting entities from an EJB container we need to place the persistence.xml file in the META-INF directory within the EJB module, BankService.jar. The package-ejb target in the Ant build file...