Lab #4 (Seam CRUD Generation - Advanced Commands)

Overview

Seam has integrated CRUD(Create Read Update Delete) application generation. You can point Seam to an existing database and generate an entire web application, a popular programming concept known as reverse engineering. This lab uses a three table data model that consists of:

In this lab, we will execute the following commands:

Lab Instructions

  1. Create Database Tables in Hypersonic
  2.          drop schema PUBLIC cascade;
             
             create table AUCTION_USER (
                USER_ID integer not null identity,
                FIRSTNAME varchar(255) not null,
                LASTNAME varchar(255) not null,
                primary key (USER_ID)
             );
    
             create table AUCTION_ITEM (
                ITEM_ID integer not null identity,
                NAME varchar(255) not null,
                DESCRIPTION varchar(255) not null,
                USER_ID integer not null,  
                primary key (ITEM_ID),
                FOREIGN KEY (USER_ID) REFERENCES AUCTION_USER(USER_ID)
             );
    
             create table AUCTION_BID (
                BID_ID integer not null identity,
                AMOUNT numeric(9,2) not null,
                ITEM_ID integer not null,
                USER_ID integer not null,
                primary key (BID_ID),
                FOREIGN KEY (USER_ID) REFERENCES AUCTION_USER(USER_ID)          
             );
            
  3. Reverse engineer Database Tables into a Full CRUD Seam Application
  4. Deploy helloworld to JBoss Application Server
  5. EXTRA CREDIT: Create a new database table called "ADDRESS" and re-generate CRUD application
    • CHEAT: cd @seamHome@
      • type: seam labs-cheat (Enter '4' for the lab cheat you want to apply)
      • Type: seam explode restart
    • NO CHEAT: Create a new database table from the HSQLDB admin screen:
      •           create table AUCTION_ADDRESS (
                     ADDRESS_ID integer not null identity,
                     STREET varchar(200),
                     CITY varchar(50),
                     COUNTRY varchar(50),
                     USER_ID integer not null,
                     primary key (ADDRESS_ID),
                     FOREIGN KEY (USER_ID) REFERENCES AUCTION_USER(USER_ID)
                  );
      • Type: seam generate-entities explode restart

Key Files

@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionAddress.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionAddressHome.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionAddressList.java

@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionBid.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionBidHome.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionBidList.java

@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionItem.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionItemHome.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionItemList.java

@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionUser.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionUserHome.java
@workspaceHome@@sep@helloworld-lab3@sep@src@sep@com@sep@mydomain@sep@helloworld@sep@AuctionUserList.java

@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionAddress.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionAddressEdit.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionAddressList.xhtml

@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionBid.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionBidEdit.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionBidList.xhtml

@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionItem.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionItemEdit.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionItemList.xhtml

@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionUser.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionUserEdit.xhtml
@workspaceHome@@sep@helloworld-lab3@sep@view@sep@AuctionUserList.xhtml


Home | Next