Honor cases in sql2005

Posts   
 
    
bunzee
User
Posts: 84
Joined: 20-Mar-2007
# Posted on: 24-Apr-2008 22:24:15   

database: sql2005 llblgen: v2.5 built 2/4/2008

Following MS convention, all the fields in the database are pascal case. Thus I have TableName.FieldName. I only use the (_) for FK relation such as TableName1.TableName2_ID.

When I generate code in llblgen, I got Tablename1.Tablename2Id. I understand that there's an abbreviation setting in llblgen designer so that I can have Tablename1.Tablename2ID.

Question: I want to get TableName1.TableName2ID. How do I do that?

Thanks,

BZ

PS: In this example it does not seem so bad but in other case where I have ClaimBillLineId and it is converted to Claimbillineid, or ExpertsExchange to Expertsexchange frowning

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 25-Apr-2008 10:54:07   

Please set both of the following project properties to false.

1- EnforcePascalCasingAlways When set to true, the setting MakeElementNamePascalCasing is always enforced. When set to false, the setting MakeElementNamePascalCasing is enforced only when names for new elements are created. Default is true. A new project inherits this value from the preferences.

2- MakeElementNamePascalCasing When set to true, all names of new entities, entity fields, typed views etc. will be properly PasCal cased. This means that each character in the name is lowercased, except the first character after each word boundary ('_' or ' ') and the first character. All spaces are always removed. When set to false, the name is left untouched, except for the first character, which will always be UpperCase. A new project inherits this value from the preferences.

bunzee
User
Posts: 84
Joined: 20-Mar-2007
# Posted on: 25-Apr-2008 19:53:38   

Walaa,

Thank you. One comment: by setting both of these params to false, the () in the name will not be removed. I kind of like the idea of removing the () and make the first letter after it capital.

So, is it possible to have all the default llblgen naming convention (i.e. remove spaces and (_) and cap the next letter) while still keep all the other caps as is.

i.e. Capital_one -> CapitalOne CapitalOne_Id -> CapitalOneId

Thank you,

BZ

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 26-Apr-2008 08:02:09   

BZ, setting _RemoveUnderscoresFromElementName to true will remove always the "". However if you specify _MakeElementNamePascalCasing to false, you wont get the Pascal casing after "".

If you only need **Id **becomes **ID **just add an abbreviation to Project Properties - Abbreviations (ID -> ID).

David Elizondo | LLBLGen Support Team