Relation Naming

Posts   
 
    
Cadmium avatar
Cadmium
User
Posts: 153
Joined: 19-Sep-2003
# Posted on: 09-Mar-2005 22:58:49   

Hi Frans,

I was wondering what you could tell me about this idea. I have a some tables that look like


Project
---------
Id (pk)
Name
...

Phase
--------
Id (pk)
Name
ProjectId (fk)
...

PhaseStatus
-----------------
PhaseId (fk)
StatusId (fk)
ProjectId (fk)
UserId

The Project table has a direct 1:m relation to the Phases table, but also has an idirect relation via the PhaseStatus table (denormalized to make reporting easier).

The problem comes with the naming llblgen applies to the relationships, because I guess it's first in the list to be processed, it gives the Field mapped via PhaseStatus the best name "Phase" (in the project entities field) and give the direct relationship the name "Phase___".

I guess my proposal would be to have direct relationships take naming priority and get the best name (the least '_' postfixes). Would something like that even be possible? I know that I can (and have) renamed them via the gui, but it would be nice if it was a default feature. What do you think?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Mar-2005 12:10:41   

Heh simple_smile Well, I see your point, though I think others would want in different situations the opposite wink .

What I've done in 1.0.2004.2 (now in beta, you can have a look) is that you can control the formatting of the names of the fields mapped on different type of relations. This means that these names don't have to clash anymore (m:n and 1:n/1:1/m:1 relations), resulting in nice long ____ simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Cadmium avatar
Cadmium
User
Posts: 153
Joined: 19-Sep-2003
# Posted on: 11-Mar-2005 16:35:41   

Otis wrote:

Heh simple_smile Well, I see your point, though I think others would want in different situations the opposite wink .

What I've done in 1.0.2004.2 (now in beta, you can have a look) is that you can control the formatting of the names of the fields mapped on different type of relations. This means that these names don't have to clash anymore (m:n and 1:n/1:1/m:1 relations), resulting in nice long ____ simple_smile

Okay, I understand simple_smile