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....