Table Constraints and Concept Relationships
When you import tables, optionally, you can import database constraints, that is, relationships between tables.
In the TIBCO BusinessEvents project the table relationships become relationships between concepts (see Concept Relationships in TIBCO BusinessEvents Architect’s Guide.) Database constraints are interpreted as contained or referenced concept relationships .
Tables Imported with Containment Relationships
After importing from tables, concept A contains concept B, if the following is true:
- Table A’s primary key is table B’s foreign key.
- And table A’s primary key is table B’s primary key in full or in part.
For example, cars contain tires:
- Table A is Car: Primary key is carID
- Table B is Tire: Primary key is (carID, tireID). Foreign key is carID.
After importing the Car and Tire tables to database concepts of the same names, the Car concept contains the Tire concept. Car has a ContainedConcept property called Tire, which points to Tire. (The REL_TYPE metadata property shows the type of relationship, as explained in the note.)
Tables Imported with Reference Relationships
After importing from tables, concept A references concept B if the following is true:
- Table A’s foreign key is Table B’s primary key.
- And table A’s primary key is not part of Table B’s primary key.
For example, orders reference sales representatives:
After importing the tables to database concepts of the same names, the Order concept references the SalesRep concept. Order has a ConceptReference property called SalesRep which points to SalesRep.
You can also allow users to import tables selectively. For further information, see Importing Selected Database Tables.