Internal and Public accessors for Entities.

Posts   
 
    
npathuru
User
Posts: 17
Joined: 14-Jun-2005
# Posted on: 25-Jul-2007 00:49:08   

Hi Just wondering if this is possible. If we have a have a table called MyTable, with column names starting with lower case and upper case and we would like to generate lower case columns as properties with internal accessor and uppercase columns with public accessor. How to achieve this. Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 25-Jul-2007 21:11:32   

That's rather tricky. In TDL you can't do that, so you have to revert to an lpt template. What you could do is using a copy of the entity include template (selfservicing is entityinclude.template, adapter is entityincludeadapter.template) and bind that copy to the include ID (SD_EntityIncludeTemplate or SD_EntityIncludeAdapterTemplate) using a custom templatbindings file which you place above the standard templatebindings file in the second tab on the generatorconfig dialog.

In the copy, you remove the property generation loop and replace it with an include statement: <# someID #>

you then bind to the ID you specified an lpt template in which you traverse the fields of the current entity, and emit code accordingly and then access the table field via the entity field (see sdk reference manual for the object model of the project) and check the casing.

However, is there a reason you want to do this? As it seems rather fragile to me, to base accessability on casing of the table field

Frans Bouma | Lead developer LLBLGen Pro