Page 1 of 1
Trying to figure out an error
Posted: Sat 14 Jul 2012 19:18
by duelingcats
Hello, I am trying to figure out why I am getting this error when I try to publish my model to my database. I am pretty new to the whole ORM idea, so you may have to explain some obvious mistake I have made.
The error I am getting is as follows:
An error occurred during creating constraint in storage model. Referential constraint property 'PersonID' association 'Instructor_Assignment' is not mapped to any column in storage table 'Employees'.
Here is my model
http://i.imgur.com/8rom4.png
I assumed that since I was inheriting from my Person class, it could use the PersonID from that class.
Re: Trying to figure out an error
Posted: Mon 16 Jul 2012 12:44
by Shalex
Could you please
send us your model so that we can reproduce the issue in our environment?
Re: Trying to figure out an error
Posted: Thu 19 Jul 2012 11:45
by duelingcats
I eventually got it working, thanks though. Would you be able to tell me how I would be able to setup a serial column on a postgresql database and have my generated code not be concerned with inserting a integer for that column since it will be auto generated. Would I be able to have that integer return back so that my object is in sync?
Also, I am trying to do a many to many relationship, but can't figure out how to do it in the modeler. I would recommend adding some more documentation. Anyway, could you tell me what these column fields are for? I am trying to make a many to many relationship of student to class using attending as the linking table.

Re: Trying to figure out an error
Posted: Fri 27 Jul 2012 10:31
by MariiaI
Sorry for the delay. According to the latter screenshot you are using LinqConnect. Please confirm this and specify whether you need the same information about using Entity Framework.
To be able to work with the autogenerated values, you should check that the following settings are set for the entity key in your model:
- Server Data Type = SERIAL NOT NULL;
- Auto-Sync = OnInsert;
- Auto Generated Value = true.
Also, we have sent you a sample project, that demonstrates how to work with autogenerated values in PostgreSQL. Please check that the letter is not blocked by your mail filter.
As for the many-to-many association, these columns point to the columns of the junction table, to which two other tables are associated.
For example, in your case:
on the Parent side - Class Property "ClassId' corresponds to the ClassID ('Attending' class), so you should set the Column to ClassID.
on the Child side - Class Property "PersonId' corresponds to the PersonID ('Attending' class), so you should set the Column to PersonID.
In this case you should remove the 'Attending' class from your model and just specify its name in the Association Editor, as displayed on your screenshot.
In another case, if you need this class to work in the model, you should create two associations (two 1-to-many associations with the Attending class on the many side).
As for the documentation, we're working on it now. Also, we would be grateful if you specify what else is unclear about working with our ORM solutions and what else we should add to our documentation.
Re: Trying to figure out an error
Posted: Fri 27 Jul 2012 11:48
by duelingcats
Thanks for the reply. Everything is working great for me now and I am enjoying the product
