Previous Topic: Defining the Task Entity

Next Topic: Defining Restrictor Processing

Owned By Relationships

Remember, the Task entity in the diagram you created in the chapter "Diagramming Entity Relationships," had two foreign keys, Employee ID and Project ID:

PLEX--Owned By Relationships

You can tell by the shading that Project ID is part of the key for Task (with Task ID). This field was added to the Task entity when you created the triple Task owned by Project. It was added because it is the key of the owning entity.

The addition of the parent key field means that when creating or accessing a task, the owning project must be specified.

How does this affect your application? Well, it means that you must provide a way for end users to specify the owning project when creating or accessing a task. To this end, you will design your application so that end users can only create and access instances of the child entity (Task) after selecting an instance of the parent entity (Project).

In your application, you will add a key code to the Edit Project panel. Remember, you already added the static text for that key code. For more information, see Add Static Text in the chapter "Modifying the User Interface."

You will add functionality so that when end users open the Edit Project panel and enter the key code to work with tasks for a project, the Edit Task panel appears. When the end users add tasks, the Project ID field is automatically populated with the ID of the project selected in the Edit Project panel:

PLEX--Owned By Relationships (2)