Preserving underscores in element names not working

Posts   
 
    
Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 16-Jun-2015 15:14:57   

The "Remove underscores from element name" project setting is not working when it is set to false. I've tried deleting all previously-generated files and regenerating from scratch but field names in my entities still have underscores removed. I've confirmed that the underscores are in the field names in the Catalog Explorer listing of entities.

I'm generating EF6, .NET4.5, General template group, SD.EntityFramework.v6 (Code First) preset.

My designer is version 4.2 Final (Feb 16 2015).

BTW, I tried to confirm that this was the latest version but cannot figure out how to access the Customer Area since the new LLBLGen.com website.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 16-Jun-2015 22:25:23   

Aren't the underscores get removed when you map new entities form the catalog explorer?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 16-Jun-2015 22:35:19   

Emmanuel wrote:

BTW, I tried to confirm that this was the latest version but cannot figure out how to access the Customer Area since the new LLBLGen.com website.

after you log in, you get a new menu entry 'My account' which contains the downloads and other info simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 17-Jun-2015 01:59:41   

Walaa wrote:

Aren't the underscores get removed when you map new entities form the catalog explorer?

(I got to the customer area and got the latest build of the designer - same result)

Yes, the underscores are being removed when I map the new entities from the catalog explorer. But why? I have the setting set to false (the default is true) and so I expect underscores to NOT be removed.

However, I realize now that my fields with underscores are being renamed because they are FKs and subject to the FK field naming pattern. So, I think it is behaving as expected.

It sure would be nice if the FK field naming pattern included an option to just leave the field name alone and not rename it. We have a convention for naming FK fields which cannot be duplicated with the LLBLGen naming pattern tokens.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 17-Jun-2015 10:42:36   

Emmanuel wrote:

Walaa wrote:

Aren't the underscores get removed when you map new entities form the catalog explorer?

(I got to the customer area and got the latest build of the designer - same result)

Yes, the underscores are being removed when I map the new entities from the catalog explorer. But why? I have the setting set to false (the default is true) and so I expect underscores to NOT be removed.

I can't reproduce it. v4.2 latest build (but this code hasn't been changed lately). I have two FK fields in an entity, FK_ID1 and FK_ID2, if I add the entity and also its PK side as entities to the project using reverse engineering I get Fk_Id1 and Fk_Id2 as entity fields. Make element name pascal casing is true, Remove underscores from element name is false in the project settings. I use the default fk pattern, which isn't used here btw.

However, I realize now that my fields with underscores are being renamed because they are FKs and subject to the FK field naming pattern. So, I think it is behaving as expected.

It sure would be nice if the FK field naming pattern included an option to just leave the field name alone and not rename it. We have a convention for naming FK fields which cannot be duplicated with the LLBLGen naming pattern tokens.

The FK field pattern isn't used in reverse engineering, it's used when FK fields are auto-created when you add a new relationship and no fk field is present yet.

I've attached the project I used which doesn't reproduce it. Simply reverse engineer FkSide and PkSide. The DB schema is some scratchpad db with garbage tables,

Attachments
Filename File size Added on Approval
testdb.llblgenproj 9,954 17-Jun-2015 10:42.53 Approved
Frans Bouma | Lead developer LLBLGen Pro
Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 17-Jun-2015 15:40:47   

Otis wrote:

Emmanuel wrote:

Walaa wrote:

Aren't the underscores get removed when you map new entities form the catalog explorer?

(I got to the customer area and got the latest build of the designer - same result)

Yes, the underscores are being removed when I map the new entities from the catalog explorer. But why? I have the setting set to false (the default is true) and so I expect underscores to NOT be removed.

I can't reproduce it. v4.2 latest build (but this code hasn't been changed lately). I have two FK fields in an entity, FK_ID1 and FK_ID2, if I add the entity and also its PK side as entities to the project using reverse engineering I get Fk_Id1 and Fk_Id2 as entity fields. Make element name pascal casing is true, Remove underscores from element name is false in the project settings. I use the default fk pattern, which isn't used here btw.

However, I realize now that my fields with underscores are being renamed because they are FKs and subject to the FK field naming pattern. So, I think it is behaving as expected.

It sure would be nice if the FK field naming pattern included an option to just leave the field name alone and not rename it. We have a convention for naming FK fields which cannot be duplicated with the LLBLGen naming pattern tokens.

The FK field pattern isn't used in reverse engineering, it's used when FK fields are auto-created when you add a new relationship and no fk field is present yet.

I've attached the project I used which doesn't reproduce it. Simply reverse engineer FkSide and PkSide. The DB schema is some scratchpad db with garbage tables,

Thanks. You're correct. I had "Emit foreign key fields" set to false and was looking at Navigator fields which, coincidentally, had the same construction pattern as my tables' FK fields but without the underscore so I mistook those for FK fields that had had their underscores removed.