rename column not reflected in gen'd classes

Posts   
 
    
pkellner avatar
pkellner
User
Posts: 19
Joined: 23-Aug-2009
# Posted on: 25-Aug-2009 01:19:38   

I was getting a warning with 2.6 because I had a column IsNew. I renamed it in my database to IsNewData, went into LLBLGen Pro Project explorer,

Did: Project/Refresh All Catalogs (connected, chose my catalog) .. (verified my table showed changed, though surprised to see they all were changed)

Then: Project/Generate (start generator)

I still get the warning:

Warning 1 'ThreePLogic.Data.ThreePLogicAccessLLBL.EntityClasses.LoadUserInfoEntity.IsNew' hides inherited member 'SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.IsNew'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. F:\MyDocuments\VSProjects\3plogic\data\ThreePLogicAccessLLBL\DatabaseGeneric\EntityClasses\LoadUserInfoEntity.cs 716 33 ThreePLogic.Data.ThreePLogicAccessLLBL

It's as if it's ignoring my database change.

When I delete the Entity from the designer and then re-add it, things work correctly. I had thought that was the purpose of refresh schema.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Aug-2009 06:22:42   

Hi Peter,

That is expected. When you refresh, the DB schema data is updated in your project, the field names are kept as changing them could break your existing code.

Consider this: You have a Column "Foo" and you map it as "Foo" in LLBLGenPro Designer. All your code is written using "Foo" field name. Then for some reason you need to change the "Column" name to "Boo". Of course you need to refresh the catalog at LLBLGenPro Designer, What would happen if the "Field" name would be renamed automatically? I think you just figure it out.

So, that is the beauty of this. You can have "XXX" Column name and map it as "YYY" Field name.

Nevertheless, the refresh process is totally configurable through Preferences and Project Properties. In this case you need to set the SyncRenamedFieldElementsAfterRefresh flag to true:

Docs wrote:

**SyncRenamedFieldElementsAfterRefresh **When set to true (default is false), LLBLGen Pro will sync manually renamed field elements after a refresh if SyncMappedElementNamesAfterRefresh is set to true. If SyncMappedElementNamesAfterRefresh is set to false, this setting is ignored. Field elements are: Entity fields and fields mapped onto relations.

David Elizondo | LLBLGen Support Team
pkellner avatar
pkellner
User
Posts: 19
Joined: 23-Aug-2009
# Posted on: 25-Aug-2009 06:32:33   

thanks. I'm just use to the ORM changing the name and the type safe nature of it all makes it easy for me to fix my code. I personally like having the c# reflect the schema.