Multiple catalog support

Posts   
 
    
erichar11
User
Posts: 268
Joined: 08-Dec-2003
# Posted on: 27-Feb-2006 06:36:23   

Just started playing with the multiple catalog support in llblgenPro. I created a project which contains two catalogs contained within sqlserver. I have access to tables (entities) in both catalogs, however I'm trying to understand how I can create a relationship between a table in catalog A with a table in catalog B. I've read the docs re: add custom relations but I'm still a little confused.

  1. If I want to create a relationship between entities in two catalogs, is the only way to achieve this through the designer and create custom relationships?

  2. If I have the following tables

Catalog A - Table1

UserId - UniqueIdentifier UserName - varchar

Catalog B - Table2

ProductId - UniqueIdentifier ProductName - varchar

In the designer for adding custom relationships between the Table1 in catalog A and Table2 in catalog B, only foreign key field name of productId exists (I believe this is by design). So my question is should I modify the db schema for Table2 and add a field called userId (same type as the PK) in order to create the relationship between the two tables? Or is there a way to do this in the designer without modifying the catalog B schema?

  1. Is there any best practices for using multiple catalog support. Looking for guidance on how to implement multiple catalog support.
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 27-Feb-2006 08:49:50   

erichar11 wrote:

Just started playing with the multiple catalog support in llblgenPro. I created a project which contains two catalogs contained within sqlserver. I have access to tables (entities) in both catalogs, however I'm trying to understand how I can create a relationship between a table in catalog A with a table in catalog B. I've read the docs re: add custom relations but I'm still a little confused.

  1. If I want to create a relationship between entities in two catalogs, is the only way to achieve this through the designer and create custom relationships?

Yes, because sqlserver doesn't allow fk constraints cross catalog borders.

  1. If I have the following tables

Catalog A - Table1

UserId - UniqueIdentifier UserName - varchar

Catalog B - Table2

ProductId - UniqueIdentifier ProductName - varchar

In the designer for adding custom relationships between the Table1 in catalog A and Table2 in catalog B, only foreign key field name of productId exists (I believe this is by design). So my question is should I modify the db schema for Table2 and add a field called userId (same type as the PK) in order to create the relationship between the two tables? Or is there a way to do this in the designer without modifying the catalog B schema?

Which fields do you want to relate to eachother? Only fields with the same type can be related.

  1. Is there any best practices for using multiple catalog support. Looking for guidance on how to implement multiple catalog support.

If possible, use 1 catalog, as you in some form, lose referential integrity. Most situations which use multiple catalogs use one catalog which is readonly and one which is writable. You can also use schemas in 1 catalog, which can be simpler as everything is in 1 catalog.

Frans Bouma | Lead developer LLBLGen Pro