Establishing a parent-child relationship among schemas
When you want to apply the referential integrity rules among multiple non-JDBC schemas, you must establish a parent-child relationship among schemas on the Schema Canvas page.
Before you begin
- Created a project.
- Fabricated the schemas in HCL® OneTest™ Data. See Schema fabrication.
- Defined the properties of schemas. See Schema design overview.
- Imported the schemas. See Importing schemas into the Schema Canvas page.
About this task
When you want to maintain a logical relationship among multiple schemas, then you must establish a parent-child relationship among those schemas. The parent and child schemas must be related to each other by using common item types. The item type of the parent schema is designated as the Primary key, and the same item type of child schema is designated as the Foreign key.
The referential integrity among the parent and child schemas in HCL OneTest™ Data supports the following relations:
- One-to-one
- One-to-many
- Many-to-one
- Self-reference
- You can establish relationships only among non-JDBC schemas.
- The item types that relate to parent-child schemas must be of the same data type and size.
Procedure
- Log in to HCL OneTest™ Server and open the team space that contains your project.
-
Open your project.
The Overview page is displayed.
-
Click
. The Data Fabrication page is displayed.
-
Click Schema Canvas.
The Schema Canvas page is displayed.
You can view the structural view of all the imported schemas and their relationships with each other.
Note: You can use the scroll wheel or pinch-to-zoom option on the Schema Canvas page to view the structural view of all schemas and relationships. - Identify the schemas for which you want to establish a parent-child relationship.
- Click the item type of the parent schema that you want to use as a Primary key.
-
Move the mouse from the item type that acts as a Primary key
of the parent schema to the item type of the child schema that must act as a
Foreign key.
A line is drawn between the parent schema and the child schema to represent the relationship among both the schemas.
- Repeat the steps to establish multiple relationships among the other schemas, if required.
Results
What to do next
You can click the Modify canvas button to modify or remove the selection of schemas that you imported into the Schema Canvas. See Modifying the selection of imported schemas.