The video store modeled in the tutorials has a database containing only five tables. Three of these tables represent the pool of customers, videos, and video suppliers, and the remaining two represent the transactions of customers renting videos and suppliers providing the videos that the store purchases. The schema of these tables are shown below.
Before using the tutorials, you should verify that there won't be any conflicts with existing tables within your database.
Column | RWDBValue Type |
name | String |
ID | UnsignedLong |
address | String |
city | String |
state | String |
zip | String |
phone | String |
Column | RWDBValue Type |
title | String |
ID | UnsignedLong |
yr | UnsignedInt |
category | String |
quantity | UnsignedInt |
numOnHand | UnsignedInt |
synopsis | String |
Column | RWDBValue Type |
name | String |
ID | UnsignedLong |
address | String |
city | String |
state | String |
zip | String |
phone | String |
Column | Type |
customerID | UnsignedLong |
videoID | UnsignedLong |
invoiceNum | UnsignedLong |
rentalDate | DateTime |
dueDate | DateTime |
returnDate | DateTime |
Column | Type |
videoID | UnsignedLong |
supplierID | UnsignedLong |
orderNum | UnsignedLong |
unitPrice | Decimal |
quantity | UnsignedInt |
purchDate | Date |
The tutorial model provides a separate class for each table in the video store's database, as well as a class representing a single row in each table. For example, the table containing the library of video titles is represented by a class called VVVideoRepository. This class encapsulates the table in the database, as well as the basic operations on that table. As a companion to the VVVideoRepository class, there is a class representing one video entry in the table. This class, called VVVideo, has one instance variable for each of the columns in the table. This class also includes member functions appropriate for a representation of a single video.
Each of the five tables in the video store's database uses this model of a pairing of two classes. One class encapsulates the table, and the other class represents one row of the table.
The table below illustrates the associations of tables, classes, and files.
We developed each of these classes more completely than necessary for use with the tutorials. The tutorials do not exploit all the functionality of these classes. You will find many useful routines implemented in the classes that can be used as example code.
All the classes that represent one row of a given table are implemented as collectable, persistable objects according to the method defined by the Essential Tools Module. The SourcePro DB tutorials do not use persistence.
Exploring the source code of these classes beyond what is used in the tutorials can help you learn both the DB Interface Module and the Essential Tools Module.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.