This project is read-only.

Double definitions in DAL

Sep 8, 2010 at 1:15 AM

I have a rather complex model I am trying to build. This model has a base table, DataObject. On top of that we have NamedObject (which derives from DataObject) and DisplayObject (which derives from NamedObject), those with names and those names and displaynames respectively.

Amongst the various tables deriving from those I have several associative tables relating them.

I have ended up with several Query objects in the DAL project with duplicate definitions of their relationship with my Employee table. The thing I found truly odd is that only one of these tables has a direct relationship with the Employee table, the rest are indirect.

I am sure I am doing something wrong, I just can't figure out what. Help?

Sep 8, 2010 at 11:55 AM

Please send your model to chrisd@nhydrate.org with some more detail like does the generated code compile? Have you run it against a database? Did you get any errors when running? Please send the code you are testing with as well letting me know if any issues you have running it. From the model I can create a database and determine what is going on.

Sep 8, 2010 at 1:59 PM

I have sent it to you from the address ndaniels@montpelier-vt.org.

Sep 8, 2010 at 6:38 PM

You have a relationship between DisplayObject and Employee which does not need to be there. This compile error comes from the fact that a child table in the hierarchy (NamedObject) already has a reference to Employee. o DisplayObject has a duplicate one with no role name. This needs to be a validation error for this condition. However you can fix your model right now by removing the DisplayObject->Employee 1:1 relation. It is not needed. You inherit the relationship from NamedObject. I will add this validation error to the framework.

Sep 8, 2010 at 6:56 PM

Dang it. I didn't even see it.

Again thanks very much. nHydrate is the best. It has probably saved me hundreds of hours of work!