BUG: Incorrect Logical Database Model Is Generated When You Use the Create Table Inheritance Option in the ORM Source Model (814727)



The information in this article applies to:

  • Microsoft Visio for Enterprise Architects (2002)

SYMPTOMS

When you build an Object Role Modeling (ORM) source model that contains a subtype object with the Create table inheritance option enabled, the database model may be generated incorrectly. In the database model diagram, the relationship between the subtype and supertype tables may be shown as a category relationship, instead of a table inheritance relationship. Also, the primary key may not be created for the subtype table.

When you perform an error check on the database model, you may receive error messages in the output window that are similar to the following:
Starting Logical Validation...
ORMTABLEINH.VSD : error C2118: 'EmployeeB' : Table/Entity has no primary identifier defined.
ORMTABLEINH.VSD : error L3001: 'EmployeeA_EmployeeB_FK1' : Parent column(s) not specified.
ORMTABLEINH.VSD : error L3002: 'EmployeeA_EmployeeB_FK1' : Child column(s) not specified.
ORMTABLEINH.VSD : error L3016: 'EmployeeA_EmployeeB_FK1' : Relationship must exist between a primary key or an alternate key designated as unique constraint.
ORMTABLEINH.VSD : error L3021: 'EmployeeA_EmployeeB_FK1' : Category relationship must be from the parent primary key to the child primary key, and both primary keys must be the same size.
Logical Validation complete - 5 error(s) 0 warning(s)

MORE INFORMATION

Do not enable the Create table inheritance option for a subtype object when you create an ORM source model for a relational database management system (RDBMS), such as Microsoft SQL Server. The Create table inheritance option is relevant only for creating models for databases that support Object Relational database features.

Steps to Reproduce the Behavior

Create the ORM Source Model

  1. Start Microsoft Visio for Enterprise Architects.
  2. On the File menu, point to New, point to Database, and then click ORM Source Model to create a new ORM source model.
  3. In the Business Rules pane, click the Object Types tab.
  4. Add the following objects. Use the RefMode value that appears in parenthesis, if mentioned:
    • EmployeeA (RefMode: EmpNo)
    • EmployeeB
  5. Click the Fact Types tab.
  6. Press F2.
  7. In the Fact Editor dialog box, click the Fact tab.
  8. Add the following Unary facts, and then click OK:
    • EmployeeA works
    • EmployeeB earns
  9. In the Business Rules pane, click the Object Types tab, and then copy EmployeeA and EmployeeB objects to the drawing page.
  10. Drag a Subtype Relations connector from the ORM Source diagram stencil to the drawing page.
  11. On the drawing page, click the Subtype Relations connector, and then drag the end point (arrow pointer end) of the connector to the EmployeeA object shape. (The end point turns red. This indicates that the connector is glued to the shape. )
  12. Drag the begin point (arrowhead end) of the connector to the EmployeeB object shape. (The begin point turns red. This indicates that the connector is glued to the shape.)
  13. In the Object Types tab, click an EmployeeB object.
  14. In the Database Properties tab, click Subtype in the Categories list.
  15. Select the Map to separate table and the Create table inheritance check boxes.
  16. In the Primary Supertype list, select EmployeeA.
  17. Save the ORM source model.

Create the Database Modeling Project

  1. On the File menu, point to New, point to Database, and then click Database Model Diagram to create a new Database Modeling project.
  2. On the Database menu, point to Project, and then click Add Existing Document.
  3. Locate the ORM Source Model that is created in the Create the Source ORM Model section, and then click Open.
  4. Save the Database Model Diagram.
  5. On the Database menu, point to Project, and then click Build.

Add the Tables to the Drawing Page

  1. In the Tables and Views pane, press SHIFT and click both the EmployeeA and the EmployeeB tables, and then drag them to the drawing page. The shapes for the EmployeeA and the EmployeeB tables are created on the drawing page and are connected by a Category relationship connector. (The primary key is not created for the EmployeeB table.)
  2. On the Database menu, point to Model, and then click Error Check.
  3. Open the Output window to view the warning message that is described in the "Symptoms" section of this article.

REFERENCES

For more information about how to create ORM source models by using Visio for Enterprise Architects, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:8/6/2003
Keywords:kbpending kberrmsg kbInheritance kbDesigner kbDatabase kbbug KB814727 kbAudDeveloper