Java Reference
In-Depth Information
• A book ID
• The author's first name
• The author's surname
• The title
• The price
• Whether the topic is on sale
• The publication year
• A description of the topic
• The number of copies in the inventory
The
Book
entity also defines a simple named query,
findBooks
.
Enterprise Beans Used in Duke's Bookstore
Two enterprise beans located in the
dukesbookstore.ejb
package provide the busi-
ness logic for Duke's Bookstore.
BookRequestBean
is a stateless session bean that contains the business methods for
the application. The methods create, retrieve, and purchase books, and update the invent-
ory for a book. To retrieve the topics, the
getBooks
method calls the
findBooks
named query defined in the
Book
entity.
ConfigBean
is a singleton session bean used to create the topics in the catalog when
the application is initially deployed. It calls the
createBook
method defined in
BookRequestBean
.
Facelets Pages and Managed Beans Used in Duke's Bookstore
The Duke's Bookstore application uses Facelets and its templating features to display the
user interface. The Facelets pages interact with a set of CDI managed beans that provide
the underlying properties and methods for the user interface. The front page also interacts
with the custom components used by the application.
The application uses the following Facelets pages, which are located in the
tut-in-
stall
/examples/case-studies/dukes-bookstore/web/
directory: