Book Image

Java EE Development with Eclipse

By : Deepak Vohra
Book Image

Java EE Development with Eclipse

By: Deepak Vohra

Overview of this book

<p>Java EE is the industry standard on enterprise computing and Oracle WebLogic Server is the most comprehensive platform for enterprise applications. The book combines Java EE with WebLogic Server in the most commonly used Java IDE, the Eclipse IDE 3.7.<br /><br />"Java EE Development with Eclipse" is the only book on Eclipse IDE for Java EE Developers. The book is a practical guide for using the most commonly used Java EE technologies and frameworks in Eclipse IDE. Sample applications are available in downloadable format and may be customized to meet requirements. Oracle Enterprise Pack for Eclipse 12c, an enhancement to Eclipse IDE, providing additional project facets and an integrated support for Oracle WebLogic Server is used.<br /><br />"Java EE Development with Eclipse" is based on developing applications with some of the commonly used technologies using the project facets in Eclipse 3.7 and its enhancement Oracle Enterprise Pack for Eclipse 12c. <br /><br />The book starts with a discussion on EJB 3.0 database persistence with Oracle database XE and Oracle WebLogic Server. JAXB is discussed in the context of bi-directional mapping between XML and Java. A generic web project is developed for PDF and Excel spread sheet reports. JavaServer Faces, the most commonly used view component in web applications is discussed for developing a data table. Facelets, which was integrated into JSF with 2.0 version is discussed in the context of templating. ADF Faces components are used to develop another user interface (UI) application. Web services are discussed with JAX-WS and JAX-RS technologies. Java EE frameworks Ajax and Spring are also discussed.</p>
Table of Contents (17 chapters)
Java EE Development with Eclipse
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding the JPA facet


We require the JPA project facet to create entity beans. We could have created a JPA project to start with, but to create a session bean facade we first created an EJB project; session beans require an EJB project by default. To add the JPA project facet, right-click on the project in Project Explorer and select Properties. Select the Project Facets node and select the JPA 1.0 project facet. Click on the Further configuration available link as shown in the screenshot:

In JPA Facet, select Platform as Generic 1.0. Select JPA implementation as Oracle TopLink 11g R1. We also need a database connection for JPA. To configure a new Connection, click on the Add connection link as shown in the following screenshot:

In Connection Profile, select the Oracle Database Connection profile, specify a connection Name and click on Next as shown in the following screenshot:

In the Specify a Driver and Connection Details window, select the driver as Oracle Database 10g Driver. Specify SID as XE, Host as localhost, Port number as 1521, User name as OE, and Password as OE. The Connection URL gets specified. Now, click on Test Connection as shown in the following screenshot:

A Ping succeeded message indicates that the connection got established. Click on Next and then click on Finish in Summary. A Connection for the JPA Facet gets configured. Click on OK as shown in the following screenshot:

The connection profile we have configured is for the JPA project facet, not to run client applications to entity beans. The data source we configured in the WebLogic server with JNDI jdbc/OracleDS is for running client applications to entity beans. Click on Apply in Properties to install the JPA facet as shown in the following screenshot:

A node for JPA Content gets added to the EJB project. A persistence.xml configuration file gets added.