TPT with designer can generate errors 3034 or 3021

I found two cases of errors generated by the EDM designer when you want to do TPT.


Error 3034:


Imagine the following scenario:


  • A table Contacts
    • ContactID (PK)
  • A table Employees
    • ContactID (PK)
    • OfficeID (Nullable, FK to Offices.OfficeID)
  • A table Offices
    • OfficeIF (PK)

To do TPT between Contacts and Employees with designer, I do the following:


  • I delete the relationship between Employees and Contacts.
  • I also delete Employees.EmployeeID property.
  • Then I add inheritance between Employees and Contacts.
  • Then, always with designer, I remap the Employees entity type and the relationship between Employees and Offices

Here I have an error because the designer “forgets” the condition IsNull=false in the relationship mapping.


Error 3021


Imagine the following scenario:


  • A table Contacts
    • ContactID (PK)
  • A table Employees
    • ContactID (PK)
  • A table Hodidays 
    • EmployeeID (PK, KF to Employees.ContactID)
    • From (PK)

I want to do TPT as previously.


In this case, I have an error 3021 because the designer “forgets” the CSDL association ReferentialConstraint which is inevitable if the FK is in the PK.


 


So ok, there are some bugs in the designer but don’t forget that designer is just here for help. So these bugs don’t prevented you to use EF. [;)]

This entry was posted in 7671, 7674, 7675, 7806. Bookmark the permalink.

2 Responses to TPT with designer can generate errors 3034 or 3021

  1. TLP says:

    So ok, there are some bugs in the designer but don’t forget that designer is just here for help. So these bugs don’t prevented you to use EF.

    Yes, they do. few people want or should know the ugly details of of the xml. These tools should raise the level of abstraction. The designer has some real problems that need to be addressed..

  2. Huh? Seriously says:

    “don’t forget that designer is just here for help.”

    Seems like a finished product it should be fully functional. Of course bugs will exist, but to say that really just makes me think EF is not a finished product. This view is reinforced by many other things, such as lack not just of documentation, but apparent thought to how EF will really be used – such as with WCF.

    I have to conclude that, although I like EF and will continue to work with it, it is really more of a beta than a finished product.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>