This tutorial guides you through the steps for making a web application that uses JPA (Java Persistence API) with 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 web application you build in this tutorial maintains a list of products and customer orders. In this tutorial, you will develop "Add Customer" and "View Orders" modules of the web application. The Add Customer module adds customers to the database. The View Orders module displays a 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.
It also provides a method for closing the 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.
Working with Java Persistence API (JPA) Mappings
Click one of the following arrows to navigate through the tutorial: