The purpose of this example is to show some common end-user operations in handling databases
\b without any need for Database Kit programming.
\b0 \
In order to run this example, you need to have an Oracle server with a demo database installed. You also have to install the
\b OracleDemo.dbmodel
\b0 from /NextDeveloper/Examples/DatabaseKit/models into your
\b ~/Library/Databases
\b0 directory, in order to establish the proper connections between the database model and the Database Kit UI Objects. If you don't have an Oracle server, you can still follow the instructions on building the nib files to quickly put together a demo.\
In order to add a new record either into the employee table or the department table, press on the appropriate
\b Insert
\b0 button and type in the data into the tableview textfields. After each
\b Insert
\b0 operation, you need to explicitly
\b save
\b0 the record. Note that the unique keys for the Em
ee Record is the Employee ID, while the unique key for the Department Record is the Department No. Similarly, after a
\b delete
\b0 operation, you'll need to explicitly
\b save
\b0 the changes.\
\fc1\cf1 \
\b\fs28 Program Organization
\b0\fs24 \
\b How to build the nib files\
1) Build the Master TableView
\b0 \
Drag a DBTableView palette object into your main window. Drag a DBModule object into the IB suitcase. Select OracleDemo as the database model. Make the proper connections from the Deparment table to the DBTableView. Set the DBTableView to be editable via the Interface Builder Inspector Panel, so that data can be entered directly into its textfields.\
\b 2) Build the Detail TableView\
\b0 Same steps as for the Mater TableView. The only difference is that you need to drag another DBModule object into the IB suitcase, and make the proper connections from the Employee table to the DBTableView.\
\b 3) Join the 2 tables
\b0 \
In order to join the 2 tables, drag and drop the employee table from the detail DBModule into the master DBModule. Note that employees will show up as a new connection of the Master DBModule under the Interface Builder Inspector Panel.\
\b 4) Build the buttons\
\b0 Note that the Fetch operation needs to be connected to the fetchAllRecords of the Master DBModule.\
Each TableView has its own insert, delete, and save to save the records corresponding to that particular table.\