PrefetchPath question

Posts   
 
    
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 24-Apr-2008 15:47:14   

Hi, (Using LLBLGen Ver2.5, VB, SQL Server 2005, WinForm)

I don't understand an error I have after making changes to my database and regenerating with LLBLGen.

Situation Table Programme has a one-to-many relationship with table Result. I've changed the PK of Programme from ProgrammeCode (string) to ProgrammeID (int) and the FK of the Result table to ProgrammeID also.

Problem The statement

prefetchPath.Add(ResultEntity.PrefetchPathProgramme)

now has the error PrefetchPathProgramme' is not a member of 'MIS.DAL.EntityClasses.ResultEntity' and has to be changed to

prefetchPath.Add(ResultEntity.PrefetchPathProgramme_)

It seems that the Result table Relations Field mapped name has changed to Programme_ for all tables that have a m:1 relationship with the Programme table.

I don't know why this has happened, but can I safely edit it in the designer back to Programme?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 24-Apr-2008 15:56:25   

Please use the Designer and goto the RoleEntity properties, re-name the field mapped on the relation from Programme_ to Programme.

Then regenerate the code.

Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 24-Apr-2008 15:58:18   

Walaa,

Many thanks. I was editing my message when you posted.

Great smile

Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 25-Apr-2008 18:25:27   

Hi, I have a minor puzzle arising from this.

I renamed the field mapped on the relation from Programme_ to Programme, regenerated the code and the result is as expected in my environment (ie field mapped name = Programme).

However, when I passed the newly generated DAL to a colleague, his solution which is a near duplicate of mine, still required the relation Field mapped name of Programme_ in a couple of classes.

What else could I/he be missing here.

Thanks again

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 26-Apr-2008 12:18:03   

He regenerated the code? If so, could it be he has some files being marked as readonly? Please examine the log produced at the end of the code generation

Frans Bouma | Lead developer LLBLGen Pro
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 01-May-2008 21:42:48   

Ok, thanks