Retrieving related entities using a non PK column

Posts   
 
    
wpfeffer
User
Posts: 11
Joined: 07-Oct-2008
# Posted on: 22-Dec-2008 21:16:55   

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= LLBLGen Pro v2.6 (Adapter code) .NET 3.5 SQL Server 2005 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I have multiple 1 : m and m : n relationships where the relationship crosses schema boundries. In this case, we are planning for future expansion where each schema would be able to easily be moved into its own database and onto its own server.

For example:


Table: Resource.ResourceContact[/u]
ResourceID                                  bigint                          PK
ContactUI                                     uniqueidentifier           PK

Table: Resource.Resource
ResourceID                                 bigint                            PK
ResourceTypeID                          int                               FK
ResourceStatusID                         int                                  FK
{etc..........}
ResourceUI                                 uniqueidentifier           ROWGUIDCOL (unique key index)

Table: Contact.Contact
ContactID                                     bigint                            PK
ContactStatusID                         int                             FK
{etc.................}
ContactUI                                     uniqueidentifier          ROWGUIDCOL (unique key index)

Now, is it possible to create a relationship between Resource.ResourceContact.ContactUI and Contact.Contact.ContactUI in LLBLGen? I would like to be able to traverse these types of relationships as easily as any other relationship in LLBLGen.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Dec-2008 05:28:46   

Relations on tables of differents catalogs are possible. You should include both schemas at LLBLGen Designer Catalog Refresh, then add a custom relation.

If the tables are at different servers, you then should use linked servers on one of them pointing to the other, then you could retrieve the tables and add the custom relations. See this: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=14522

David Elizondo | LLBLGen Support Team