EJB's entity beans are the most common technology for database persistence. Developing entity EJBs requires a Java IDE, an application server, and a relational database. Eclipse 3.7 provides wizards for developing entity beans and session facades. In this chapter, we shall develop EJB 3.0 entity beans including session facades. We shall deploy the EJB application to WebLogic Server 12c (12.1.1) and test database persistence with the Oracle database 11g XE. In this chapter, we shall learn the following:
Configuring a data source in WebLogic Server (WLS) with the Oracle database
Creating tables in the Oracle database
Creating an Enterprise JavaBeans (EJB) project
Adding the Java Persistence API (JPA) project facet
Generating entity beans from database tables
Creating a session bean facade
Creating the
application.xml
fileCreating a test client
Packaging and deploying the entity bean application
Testing the JavaServer Pages (JSP) client