Java Reference
In-Depth Information
As we can see, NetBeans generates a folder for each of our entities under the
Web
Pages
folder of our application. Each of the folders has a
Create
,
Edit
,
List
, and
View
XHTML files. These files are JSF pages that use Facelets as their view technology;
since we selected the PrimeFaces template, our pages use PrimeFaces components.
The
Create
page will provide functionality to create new entities, the
Edit
page will
allow users to update information for a specific entity, the
List
page will display
all instances of a specific entity in the database, and the
View
page will display all
properties for a JPA entity.
The generated application is a regular JSF application. We can execute it by simply
right-clicking on the project and selecting
Run
. Then, the usual things happen: the
application server is started if it wasn't already up, the application is deployed,
and a browser window opens to display the welcome page for our application.
As we can see, the welcome page contains a link corresponding to each of our JPA
entities. The links will render a table that displays all the existing instances of our
entity in the database. When we click on the
Show All Customer Items
link, the
following page is shown: