16.10.2015 Views

Getting Started with WebSphere Application Server

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Note:<br />

Chapter 5 – Enterprise Java Beans 97<br />

The configuration id for server and client environments should be different.<br />

The application client <strong>with</strong> its deployment plan can be packaged as a jar file. Figure 5.2<br />

provides an example of a jar file structure. All the class files are built by Eclipse<br />

automatically from the source code created above; geronimo-application-client is<br />

the deployment plan for this application client.<br />

Figure 5.2 - Jar file structure of an application client <strong>with</strong> its deployment plan<br />

Deploy and run the application client <strong>with</strong> this command.<br />

java -jar /bin/client.jar [PATH to application client]<br />

For example:<br />

java -jar /bin/client.jar<br />

HelloAppClient/HelloEJBAppClient<br />

5.4 Java Persistence API Entities Development in Community Edition<br />

Java Persistence API (JPA) is a new API as part of the Java EE 5 platform for data<br />

persistency. Although JPA is part of EJB 3.0, its development process is quite different<br />

from an EJB. This section describes how to develop JPA entities in Community Edition.<br />

There are two methods to create JPA entities:<br />

• Create JPA entities manually <strong>with</strong> JPA annotations<br />

• Generate JPA entities from tables of a database<br />

5.4.1 Creating JPA entities manually<br />

To create JPA entities manually, you need to use the annotation defined in the JPA<br />

specification. All the annotations defined there, such as @Entity, @EntityManager,<br />

@PersistenceUnit and so on, can be used in your JPA classes.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!