Java Reference
In-Depth Information
Running the JSF user interfaces
In this section, we shall run the JSF pages and add data to the database tables using
the EJB 3.0 entity beans for database persistence. We need to re-create the database
tables
SECTION
and
ARTICLE
to include columns that map to the join tables of the EJB
3.0 relationships. The join tables are automatically generated when the EJB 3.0 entity
beans are invoked. Drop the
SECTION
and
ARTICLE
tables and re-create the tables
with the following SQL script:
CREATE TABLE ARTICLE (id VARCHAR(100) PRIMARY KEY NOT NULL,
title VARCHAR(100), author VARCHAR(100),
SECTION_ID VARCHAR(100), EDITION_ID(100));
CREATE TABLE SECTION (id VARCHAR(100) PRIMARY KEY NOT NULL,
section VARCHAR(100), EDITION_ID VARCHAR(100));
First, we need to add a project dependency in the
ViewController
project on the
Model
project. Right-click on the
ViewController
project node and select
Project
Properties
:
In the
Project
Properties
window, select the
Dependencies
node and select
Edit
Dependencies
. In
Edit
Dependencies
, select the
Model
project
Build
Output
and
click on
OK
. In the
Dependencies
window, click on
OK
. Before creating a
Section
entity, we need to create an
Edition
entity and before creating an
Article
entity,
we need to create a
Section
entity, because the JSF pages are so designed.
Search WWH ::
Custom Search