OneToMany relation does not use the correct parent key

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

OneToMany relation does not use the correct parent key

Post by lasseschou » Wed 20 Jan 2010 12:33

I have a class "ContractPartner" with three properties:
Id (int, primary key)
Name (string)
PartyId (int)

I want to create a one-to-many association with another class "Port". It has a property "PartyId" that indicates which ContractPartner it belongs to.

So I've created an association with ContractPartner as the parent class and Port as the child class, and I've chosen "PartyId" as both the parent and child property to use.

But when I run my program the relation is matched on "Id" on the parent class instead of "PartyId".

If I look in the generated code, the attributes for the association looks like this:

Code: Select all

[Association(Name="ContractPartner_Port", Storage="_ContractPartner", ThisKey="PartyId", IsForeignKey=true)]
If I change it manually to this, it works just fine:

Code: Select all

[Association(Name="ContractPartner_Port", Storage="_ContractPartner", ThisKey="PartyId", OtherKey="PartyId")]
Now how do I get my Entity Developer (using version 2.50.50) to generate this for me?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 21 Jan 2010 09:00

Thank you for the report, I have reproduced the problem.
I will let you know as soon as it is fixed.

lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

Post by lasseschou » Wed 27 Jan 2010 10:14

Hi,

any idea about the ETA of this fix?

Lasse

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 28 Jan 2010 13:56

We have fixed the problem. The fix will be included in the nearest build.

lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

Post by lasseschou » Thu 28 Jan 2010 14:53

Fantastic! How can I get notified when the next build is ready for download?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 28 Jan 2010 15:05

I will let you know when the build is available. Also, follow the announcements on the forum.

Post Reply