HTML and CSS Reference
In-Depth Information
-- Create Table: BOOK_REQUEST
--------------------------------------------------------------------------------
CREATE TABLE BOOK_REQUEST
(
ID INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)
,BOOK_ID INTEGER NOT NULL
,USER_ID VARCHAR(64) NOT NULL
,REQUEST_TIME BIGINT
,RESPONSE_TIME BIGINT
,STATUS INTEGER NOT NULL
);
-- Create Foreign Key: BOOK_REQUEST.USER_ID -> MEGA_USER.ID
ALTER TABLE BOOK_REQUEST ADD CONSTRAINT FK_BOOK_REQUEST_USER_ID_MEGA_USER_ID FOREIGN KEY (USER_ID)
REFERENCES MEGA_USER(ID);
-- Create Foreign Key: BOOK_REQUEST.BOOK_ID -> BOOK.ID
ALTER TABLE BOOK_REQUEST ADD CONSTRAINT FK_BOOK_REQUEST_BOOK_ID_BOOK_ID FOREIGN KEY (BOOK_ID)
REFERENCES BOOK(ID);
-- Create Foreign Key: USER_GROUP.USER_ID -> MEGA_USER.ID
ALTER TABLE USER_GROUP ADD CONSTRAINT FK_USER_GROUP_USER_ID FOREIGN KEY (USER_ID) REFERENCES MEGA_
USER(ID);
Constructing Service Layer (EJBs)
After creating the data model, we need to define the application APIs (services) which will be used from the JSF
backing beans. Mega App utilizes EJB technology in order to expose the application services for the client (JSF
Backing beans). In Mega App, we have the following three business manager EJBs:
Book Manager EJB.
Book Request Manager EJB.
Mega User Manager EJB.
Book Manager EJB is responsible for handling the topic management operations, which are
Registering new books.
Updating a book information.
Removing a book.
Getting the topic information.
Getting a book content.
Getting all topics.
Book Request Manager EJB is responsible for handling the topic request flow operations, which are
Sending a book request by an application user.
Approving a book request by an application administrator.
 
Search WWH ::




Custom Search