![]() |
![]() |
![]() |
![]() |
This tutorial guides you through the steps for making a web application that uses JPA (Java Persistence API) with BEA Kodo.
Kodo provides access to relational databases using an implementation of the EJB 3.0 Persistence standards. This allows a Java developer to use relational database technology without being an expert in relational database design.
The sample application used in this tutorial is a web application for a company
selling various products. The application maintains list of products for sale
and customers who placed orders.
In this tutorial, you will develop "Add Customer" and "View Orders" modules of the web application. The Add Customer module should add customer to database. The View Orders module should display list of customers who had placed orders and an overview of each order.
The following are the software components of the sample web application.
Hypersonic database files for SalesDB database.
The CustomerDAO is an interface, which defines methods for
retrieving the customer details.
The CustomerDAO_Kodo class implements CustomerDAO
interface and uses Kodo JPA for retrieving customer details.
The OrderDAO is an interface, which defines methods for
retrieving the order details.
The OrderDAO_Kodo class implements OrderDAO interface
and uses Kodo JPA for retrieving order details.
The DAOHelper class creates JPA EntityManagerFactory class
based on the Persitent configuration file persistence.xml
file. It also provides method for closing given JPA EntityManagerFactory.
The DAOFactory is a factory class for creating DAO instances, which
uses Kodo for persistence.
Provides a form to add a new customer. Sends request to addCustomer( ) method of Customer bean.
Displays complete list of customers. Provides facility to view orders of specific customer.
Displays a list of orders placed by a specific customer.
CSS file to customize appearance of JSP pages.
A factory class for retrieving localized messages from the application resource file.
A resource bundle that contains a series of keywords and values.
Configuration file defining JSF components.
You will create workshop-jpa-tutorial project from the sample web application which contains database files and resources (.java, .css file and .jsp files) for Kodo based Web application. Using the resources and steps described in this tutorial, you will learn how to develop a Kodo web application using Workshop.
Working with Java Persistence API (JPA) Mappings
Click one of the following arrows to navigate through the tutorial:
![]() ![]() |