Regenerating code isn't working

Posts   
 
    
tprohas
User
Posts: 257
Joined: 23-Mar-2004
# Posted on: 24-Jan-2005 21:08:11   

I have just defined a unique constraint on a table column where there wasn't one before, regenerated the code and still see a one to many relationship in the LLBLGen designer where I expect to see a one to one relationship. I have now tried deleting the entity and re-adding it and still have the problem. The CustomerOrder to the Shipment is where I am seeing the one CustomerOrder to many Shipments. I added the unique constraint on the Shipment.CustomerOrderID column and regenerated the code expecting to see the one to many change to a one to one relationship and it didn't. Does anyone have an idea what I might do to solve the problem?

Aaron

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 25-Jan-2005 10:50:27   

Please check if the unique constraint is defined on the TABLE, using the catalog explorer, click the table, and on the table in teh catalog details viewer, click with the RMB and select view unique constraints.

Also make sure the unique constraint is not defined as a unique INDEX, because these aren't seen by the sqlserver driver.

Frans Bouma | Lead developer LLBLGen Pro
tprohas
User
Posts: 257
Joined: 23-Mar-2004
# Posted on: 25-Jan-2005 21:15:46   

Otis wrote:

Please check if the unique constraint is defined on the TABLE, using the catalog explorer, click the table, and on the table in teh catalog details viewer, click with the RMB and select view unique constraints.

Also make sure the unique constraint is not defined as a unique INDEX, because these aren't seen by the sqlserver driver.

Does it matter that I also have a clustered index on the same column that the unique constraint is on? I orginally had only a unique clustered index on the CustomerOrderID column. I then changed the unique clustered index to a clustered index, and added the unique constraint to the CustomerOrderID column. So to answer your question the column is using a unique constaint and not a unique index.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Jan-2005 10:56:00   

Indexes are not read so these should not affect if a unique constraint is read or not. What I'd like to know is if the catalog explorer enlists the unique constraint on the table. If not, it's not read from the catalog and therefore not appearing in the entity. If it does enlist the unique constraint some problem in the code arised and I've to check your .lgp file for details. But first things first: the unique constraint on the table in the catalog explorer, is it there or not? simple_smile

Frans Bouma | Lead developer LLBLGen Pro
tprohas
User
Posts: 257
Joined: 23-Mar-2004
# Posted on: 26-Jan-2005 20:36:16   

Otis wrote:

Indexes are not read so these should not affect if a unique constraint is read or not. What I'd like to know is if the catalog explorer enlists the unique constraint on the table. If not, it's not read from the catalog and therefore not appearing in the entity. If it does enlist the unique constraint some problem in the code arised and I've to check your .lgp file for details. But first things first: the unique constraint on the table in the catalog explorer, is it there or not? simple_smile

Otis,

I don't know what happend, but its finally working and I haven't changed anything related to this problem. As I have been making other changes in the project and regenerating the code the problem has gone away.

Thanks again for your time.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Jan-2005 21:03:56   

Glad it's solved simple_smile

Frans Bouma | Lead developer LLBLGen Pro