Skip to main content

The Contact Management Application

The tutorial includes several examples and exercises that involve connecting Java code to a sample Caché application. This Contact Management application allows users to maintain a list of contacts and associated phone numbers in the database. From a relational perspective, it consists of two Caché tables: Contact and PhoneNumber.

generated description: contactandphonenumberentitydiag

The above diagram displays the tables' attributes as well as their stored procedures. The diagram also displays the relationship between the two tables. The entities form a parent-child relationship. Each PhoneNumber is associated with one and only one Contact. Each Contact can be associated with many PhoneNumbers.

Contact contains the following:

  • ID: The Caché object ID. Provides a primary key for the Contact table.

  • ContactType: Represents the type of the contact. Possible values include only “Business” and “Personal”.

  • Name: Represents a contact's name. Possible values include any string.

  • RetrieveByContactType: Stored Procedure. Accepts a ContactType value as an argument. Returns the Name values of all matching Contact rows.

  • ListOfContacts: Stored Procedure. Retrieves the ID values for all Contact rows.

PhoneNumber contains the following:

  • Contact: This column provides a foreign key. For each PhoneNumber row, it contains the ID of the associated Contact row.

  • ID: The Caché object ID. Each instance will have a unique value. The Studio development environment does not display this property in the class definition.

  • PhoneNumberType: Represents the type of the phone number. Possible values include only: “Business”, “Home”, “Mobile”, and “Fax”.

  • Number: Represents the phone number. Possible values include any string.

  • RetrieveByContactName: Pre-defined query. Accepts a Contact Name value as an argument. Returns the ID values of all PhoneNumber rows associated with the Contact.

Note:

To complete the exercises you must install the Caché Contact Management application. Click here for more information on installing this application as well as for information on the Java source files that have been provided for your convenience.

FeedbackOpens in a new tab