PrefetchPath and underscore

Posts   
 
    
jw
User
Posts: 10
Joined: 28-Jul-2005
# Posted on: 02-Nov-2007 15:57:13   

I am using version 1.0.2005.1 for a legacy project and my target DB is MS SQL Server 2000. I have a table called Estimate that has several units of measure which are resolved via a m:1 relation to a parent table called UnitOfMeasure (PK is UnitOfMeasureID). Each relationship is mapped to a different field in the child. The Estimate table has the following fields for example:

Estimate.MaterialQtyUnitOfMeasureID m:1 to UnitOfMeasure Estimate.LaborQtyUnitOfMeasureID m:1 to UnitOfMeasure Estimate.UnitCostUnitOfMeasureID m:1 to UnitOfMeasure etc.

The generated code builds prefetch paths that are named like this:

PrefetchPathUnitOfMeasure PrefetchPathUnitOfMeasure_ PrefetchPathUnitOfMeature__ etc.

Other than manually modifying the names of the Fields mapped on relations in the designer, is there an easy way to name the prefetch paths? Something like:

PrefetchPathMaterialQtyUnitOfMeasure PrefetchPathLaborQtyUnitOfMeaure PrefetchPathUnitCostUnitOfMeasure

Thanks for your help.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Nov-2007 16:03:03   

Other than manually modifying the names of the Fields mapped on relations in the designer, is there an easy way to name the prefetch paths?

The best error-free solution is the one using the Designer, otherwise you may modify the generated code, but that will be overwritten the next time you re-generate the code.

jw
User
Posts: 10
Joined: 28-Jul-2005
# Posted on: 02-Nov-2007 16:47:00   

Walaa wrote:

The best error-free solution is the one using the Designer, otherwise you may modify the generated code, but that will be overwritten the next time you re-generate the code.

Thank you for the quick reply. I will continue to use the designer as you suggest.

Do you know why the naming convention was selected and can you tell me if it behaves differently in version 2.x?

Thank you again.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Nov-2007 04:45:04   

The same in v2.0. IMHO, you give the meaning to the name of relation (so the prefetchPath). For example, if you have a Employee - Employee relation (an employee have a manager). So what will be the name? maybe ReportsTo, Manager, ManagerEmployee, etc. The better choice is the one selected by you.

David Elizondo | LLBLGen Support Team
jw
User
Posts: 10
Joined: 28-Jul-2005
# Posted on: 05-Nov-2007 15:59:40   

daelmo wrote:

The same in v2.0. IMHO, you give the meaning to the name of relation (so the prefetchPath). For example, if you have a Employee - Employee relation (an employee have a manager). So what will be the name? maybe ReportsTo, Manager, ManagerEmployee, etc. The better choice is the one selected by you.

Thank you. I have given the relationship two meaningful names already--the FK constraint and the FK column name. In my case, there is only one FK column for each relationship simple_smile . I was just wondering if there was a way to change the behavior to use one of these two methods instead of the default naming convention. I can see that some users may not want to do this, but in my case it would be helpful. I can continue manually to modify the names in the designer though. I'll use some of the free time created by no longer having to debug my object presistence layer wink . Thank you.