Using Array Table
In a one-to-many relationship, a collection is used for handling the multiple objects such that it is simpler to retrieve each object from the collection one by one. Visual Paradigm promotes the idea of Array Table which allows users to retrieve objects in the form of primitive array, instead of a collection when handling a data column with cardinality of many. Visual Paradigm allows you to create an array table in the entity and define an array type in the classes.
Converting an Entity to an Array Table
You can create an Array Table for the Entity with a column containing more than one instance of data.
- Locate the "many" side of an one-to-many relationship. In the following example, the phone book has a contact entry for each contact person. Each contact person may have more than one phone numbers. A one-to-many relationship between contact entry and contact phone is established.
Entities with One-to-many relationship
- Right-click on the entity for the data column with cardinality of many, select Convert to Array Table from the popup menu.
Convert to Array Table
- A warning message will be displayed, showing that the listed constraints are not satisfied for converting to array table. Click Yes to let Visual Paradigm to resolve the constraints automatically. Click No to cancel the conversion to array table.
- The conversion to Array Table is completed and the entity for the data column is stereotyped as <<Array Table>>.
Array Table formed
Defining an Array Type for Attribute in Class
A class with an attribute of array type modifier means that the attribute may contain more than one data; thus it implies the idea of Array Table. You can define the array type for the attribute in one of the two ways:
Double click on an attribute to edit it inline. Then, edit its type by appending the  sign, which indicates that the attribute is an array.
|Editing attribute inline
Editing Type Modifier in Attribute Specification Window
Right click on an attribute and select Open Specification... from the popup menu. In the Attribute Specification window, choose  as Type modifier.
|Selecting  as Type Modifier
The following resources may help you to learn more about the topic discussed in this page.
- FREE Online Training - Database Design and Management
- Visual Paradigm on YouTube
- Visual Paradigm Know-How - Tips and tricks, Q&A, solutions to users' problems
- Contact us if you need any help or have any suggestion
|14. Using Discriminator Column||Table of Contents||16. Using Partial Table|