Class Association - column name Issue

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Class Association - column name Issue

Post by RobertK » Tue 18 Apr 2017 03:02

When you create an association the column name is always "Id"

This causes a problem because the primary id column name is often "Id", also when you keep adding new association the column name would also be "Id" it causes conflict.

By default, shouldn't the associated column name be the name of the primary key of the assoicated class/table?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Class Association - column name Issue

Post by Shalex » Thu 20 Apr 2017 13:43

We cannot reproduce the issue. Entity Developer checks if the name ("Id") is used in CSDL / SSDL and, if so, generates a different name ("Class1Id", "Id1", etc).
If this information doesn't help, send us a test model and specify the exact steps for reproducing.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Class Association - column name Issue

Post by RobertK » Thu 20 Apr 2017 14:04

I tried this multiple times.

The property that gets added is always "id", add a number of associations and you will see all foreign key properties are added as "id"

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Class Association - column name Issue

Post by Shalex » Thu 20 Apr 2017 19:02

1. Is your model *.edml or *.efml?
2. Where does the naming issue persist (in CSDL or in SSDL)?
3. If it is possible, please send us a test model and specify the exact steps for reproducing.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Class Association - column name Issue

Post by RobertK » Fri 21 Apr 2017 06:01

Issue is highlighted in yellow

This is when you add a 1.* all associations property name is correct, but all column naming of "Id" this is incorrect it should be the same as the property name!
https://imghost.io/images/2017/04/21/Cl ... 155817.png

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Class Association - column name Issue

Post by RobertK » Fri 21 Apr 2017 06:04

Note: If you fix this bug, and make the column name the same name os the property name, it will cause a different type of bug! (it be ok for sql server, but not ok for mysql, postgres)

Since I am using postgres, I want all table names and column names to be snake casing.
Right now snake casing is not supported by entity developer! snake casing is the standard naming convention for mysql and postgres.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Class Association - column name Issue

Post by Shalex » Fri 21 Apr 2017 17:07

RobertK wrote:when you add a 1.* all associations property name is correct, but all column naming of "Id" this is incorrect it should be the same as the property name!
Thank you for your report. We have reproduced the bug and will notify you when it is fixed.
RobertK wrote:I want all table names and column names to be snake casing.
The Snake case in both Model and Database naming rules is supported. We will notify you when the new build of Entity Developer is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Class Association - column name Issue

Post by Shalex » Fri 26 May 2017 16:48

The Snake case in both Model and Database naming rules is supported via the new "Add underscore" option in the new build: viewtopic.php?f=32&t=35443.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Class Association - column name Issue

Post by RobertK » Tue 30 May 2017 14:45

Shalex wrote:The Snake case in both Model and Database naming rules is supported via the new "Add underscore" option in the new build: viewtopic.php?f=32&t=35443.
this is very cool, thanks! huge time saver!

Post Reply