![]() |
![]() |
![]() |
![]() |
This tutorial uses a sample application and the HypersonicSQL database to demonstrate the features for working with Hibernate web application in BEA Workshop.
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. The diagram below shows the database tables used in this application.
In this tutorial, you will develop "Add Customer" and "View Orders" modules of the web application. The Add Customer module should add customers to database. The View Orders module should display a list of customers who have 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.
JDBC driver for accessing Hypersonic database. (Note that this tutorial uses an in-memory database that will not be written to disk.)
The CustomerDAO is an interface, which defines methods for retrieving the customer details. The CustomerDAO_Hibernate class implements CustomerDAO interface and uses Hibernate API for retrieving customer details.
The OrderDAO is an interface, which defines methods for retrieving the order details. The OrderDAO_Hibernate class implements OrderDAO interface and uses Hibernate API for retrieving order details.
The DAOHelper class creates Hibernate SessionFactory class based on the Hibernate configuration file hibernate.cfg.xml file. It also provides method for closing given Hibernate Session. The DAOFactory is a factory class for creating DAO instances, which uses Hibernate 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 default properties file that contains a series of keywords and values.
Configuration file defining JSF components.
You will create Workshop-Hibernate-tutorial project from the sample web application which contains database files and resources (.java, .css file and .jsp files) for Hibernate Web application. Using the resources and steps described in this tutorial, you will learn how to develop Hibernate Web applications using BEA Workshop.
Click one of the following arrows to navigate through the tutorial:
![]() ![]() |