×
Back to book

Using the Entity Diagram

This takes you step-by-step through the entity diagram, working through the Timesheet example project.

If you are not familiar with entity diagrams or database schemas, please read the Entity Diagram Basics article for definitions of what entities, relationships, attributes, etc. are and how to use them.

  1. Navigate to the Build section and open the entity diagram.

  2. Add an entity to the diagram using the palette on the left-hand side.

  3. In the properties panel on the right, give it a name (Staff) and description. The other fields will be filled out in a different step.

  4. Add an attribute (Decimal) to your entity and fill out its properties (Name: Hourly Wage) (tool tips are available against the properties for more information).

  5. Add in another entity (Timesheet) with its own attribute (Type: Decimal, Name: Hours Worked).

  6. Create a relationship between the entities by clicking on the edge of one (Staff), and dragging the arrow which appears over to the other one (Timesheet).

  7. When you let go of the drag, select the type of relationship (One to Many) you want to make (this can be changed later by clicking on the relationship and editing its properties).

  8. Give the relationship a name (Timesheet), and a reverse name (Staff). The reverse name is important when you have multiple relationships between two entities, and is used to uniquely identify the relationship.

  9. Optional: Adding an enumeration (enum):

    a. Add an enum to the diagram.
    b. Add a literal into that enum.
    c. In one of the entities, add in an enum attribute.
    d. Create a relationship between that attribute and the enum by clicking on the edge of the attribute and dragging a relationship to the enum itself. You won't be asked for a relationship, because there is only one type which can be used in enums.
    e. For the purpose of this demo, the enum, relationship, and enum attribute should all be removed.

  10. Add the User behaviour into one of the entities (Staff), which will allow users to login to the app once built.