Pluralization of Entity names and Methods

Posts   
 
    
Kevinksy
User
Posts: 27
Joined: 05-Jun-2013
# Posted on: 30-Aug-2013 19:32:17   

LLBL 4.0 Final Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production Database first Code Generation Visual Studio 2010 using C# Target Framework LLBL Gen Pro Runtime Framework Target language C#, platform .NET 4.0 Template Self Servicing Selected Preset SD.Presets.SelfServicing.General

When I generate code Tables with names like TASK_STATUS are converted to TaskStatu

1) What is the setting to use Pascal case but do not drop the 's'? eg TASK_STATUS => TaskStatus

2) A table named MOU_AGREEMENT_TYPE_LOCALE becomes an entity called MouAgreementTypeEntity which is fine but the access method is called public static IPrefetchPathElement PrefetchPathMouAgreementTypeLocales with an 's' on the end

What is the setting to not add an 's' to access methods? eg MOU_AGREEMENT_TYPE_LOCALE => MouAgreementTypeEntity has a method

public static IPrefetchPathElement PrefetchPathMouAgreementTypeLocale

Thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 31-Aug-2013 08:21:25   

Kevinksy wrote:

Tables with names like TASK_STATUS are converted to TaskStatu

1) What is the setting to use Pascal case but do not drop the 's'? eg TASK_STATUS => TaskStatus

That seems like a pluralization exception. You can grab the plugin source code from the LLBLGen site download, and see what are the exceptions given, you can add your own and build your own version of the pluralization plugin.

Kevinksy wrote:

2) A table named MOU_AGREEMENT_TYPE_LOCALE becomes an entity called MouAgreementTypeEntity which is fine but the access method is called public static IPrefetchPathElement PrefetchPathMouAgreementTypeLocales with an 's' on the end

That depends on the relationship asociated to that path. If the relationship is 1:n, then the path should be plural. Singular otherwise.

David Elizondo | LLBLGen Support Team
Kevinksy
User
Posts: 27
Joined: 05-Jun-2013
# Posted on: 03-Sep-2013 16:41:28   

If I understand correctly you are saying: -there are no built in options to change whether entities that end in an 's' have that letter removed -if an entity has a 1:n relationship all methods will be pluralized and there is no option for this

Is this right?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 03-Sep-2013 18:46:58   

Please check these:

How to disable name singularization

And check Name Constructions and Name Patterns properties in the Project Settings

Also note that the designer ships with two examples of that: the pluralization and singularization. Please check: Designer Event Plug-in Binder

Kevinksy
User
Posts: 27
Joined: 05-Jun-2013
# Posted on: 03-Sep-2013 18:55:13   

Thank you, that does the job.