Honoring Table Case in Generated Code

Posts   
 
    
nyronian
User
Posts: 8
Joined: 27-Jul-2006
# Posted on: 19-Dec-2006 17:47:15   

I have noticed that the generated code does not respect the case of the table names in the database. For example:

A table name ABCargh would generate to AbcargEntity

What is odd is if I have a table named say: RoleUser it translates properly to RoleUserEntity.

This also holds true for column names. It changes the case. It seams that when there are multiple caps next to each other, it does not honor the name of the table.

How can this be corrected? Is there an option that needs turned on? Caps in Table & Field names have specific meaning and now I am coding to objects that have lost their meaning because of the loss in case.

Thanks in advance.

Jim

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 19-Dec-2006 19:01:57   

Just change the case to what you need in the GUI designer. Do this by editing an entity/typedlist/etc and changing the Entity name to whatever you want.

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 20-Dec-2006 01:13:18   

You can modify this behavior in File->Preferences for all new projects and under Project-Properties under existing projects. These settings exist in the Name Construction area. You will want to turn off all of the values that enforce Pascal Casing.

nyronian
User
Posts: 8
Joined: 27-Jul-2006
# Posted on: 20-Dec-2006 05:09:55   

Thank you very much...i will check it out.... smile

nyronian
User
Posts: 8
Joined: 27-Jul-2006
# Posted on: 20-Dec-2006 17:30:47   

Ok...so that will keep my casing....the next problem is, when generating and there is a name change to a column or something, LLBLGen updates the mapping to the Table/Column but does not update the Entity and Element names that are generated. Those have to be done manually.

First of all, I can understand why you don't change them but....is there a way to force the generation to change the Entity/Element names to match their DB counterparts?

In the case of this issue, I would like it to update all the naming to the proper casing...the only way I can see doing that is to drop the mappings and readd it.

Thanks Jim

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 20-Dec-2006 18:33:48   

LLBLGen GUI File | Preferences, set "SyncMappedElementNamesAfterRefresh" to true.

Not sure if the above setting will resync mapped names if just the case is different - I doubt it. You will probably have to drop and re-add like you said.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 21-Dec-2006 11:08:23   

The name will be synced with the target name (== db element) if the name is different, which is checked using a normal string compare (currentname!=targetname) and if the names are different, the element name is updated. THis is done during a refresh of the catalog(s).

Frans Bouma | Lead developer LLBLGen Pro