Duplication of Key when adding a primary key to an existing table

Posts   
 
    
jackscoldsweat avatar
Posts: 16
Joined: 11-Oct-2004
# Posted on: 31-Mar-2005 00:29:53   

Hi there

I tried searching for this in the forums but couldn't find it - forgive me if I'm asking an old question

I have a Database which had a couple of tables with no primary keys. I found I couldn't update the records in these tables and realised this must be what the LLBL was warning me when I refrehsed the catalogue in the LLBL project

So I added a field to my SQL Server Tables, made it of type UID, made it non-nullable, declared it as the PrimaryKey and called it "InstructorID" since the table contains "Instructor" records

WHen I generated the code (using either base classes only or VS.net Full/Safe) I noticed that the DAO, Validators and base Classes gave errors because their various routines that passed and received the GUID all had the GUID duplicated: e.g.

        

Public Sub New(instructorID As System.Guid, instuctorID as System.GUID)

InitClassFetch(instructorID, instructorID, new InstructorValidator(), new PropertyDescriptorFactory(), new InstructorEntityFactory(), Nothing)

End Sub

The error was something like "InstructorEntityBase ... already has parameter InstructorID"

I went thru and manually deleted the duplicates from all the classes and it resolved all the errors - and subsequent code generations have not put them back...

Seemed a bit weird - is there something I do not understand? Is this a bug?

The instructor table was made of of foreign keys and had relationships - it basically describes the role a "StaffEntity" had to a "ClassEntity" i.e. they were the instructor for that Class

Just curious

Randall

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

This is an issue which is fixed some time ago. Could you please check if you're using a recent build of the LLBLGen Pro designer? (the date in the about box?). If possible, upgrade to the latest installer, downloadable from the customer area -> upgrades section.

Frans Bouma | Lead developer LLBLGen Pro