re: ThreadID=14975

Posts   
 
    
wpfeffer
User
Posts: 11
Joined: 07-Oct-2008
# Posted on: 23-Dec-2008 17:56:15   

[This thread is regarding: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=14975]

Thank you for the quick response. I understand creating custom relationships in the designer, however, it will allow me to only create relations on some flavor of integer (int32, int64, int8, etc.), I need to be able to create the relationship on GUID columns. Is there a way to do this in LLBLGen.

I already have both schemas included in the catalog (they both currently belong to the same database as well).

I gues what I'm asking for is: Can LLBLGen construct relationships between two tables based on columns other than the PK columns and integer based columns?

I also understand that using non-PK columns for relationships is a very bad thing to do in database design, that would be why I haven't done that in the database it self, but I still need to be able to relate the entities in code, preferably via their row GUID's.

Thank you.

Wayne E. Pfeffer

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-Dec-2008 06:14:50   

Hi Wayne.

You can use GUID fields on your relations as long as they look like candidates for a relation. That means that at least:

  • The two related fields are of the same type.
  • The field(s) at PK-side is(are) PK.

you can promote a field to be part of the primary key at LLBLGen Designer as long as the field isn't nullable at database.

Pretty much the same rules a database system enforces, for the sake of data integrity. So, in brief, no support for that in LLBLGen Designer. In v2.6, a new class was introduced called DynamicRelation. With that you can create in code a relation between a derived table definition and entities.

See this discussion about relations on non key fields, and... this thread about GUIDs.

David Elizondo | LLBLGen Support Team