Dyanmic Relationships

Posts   
 
    
Posts: 87
Joined: 17-May-2011
# Posted on: 21-Sep-2011 12:18:34   

Hi there

I know about dynamic relationships that they are used when a relationship is not defined and we need to join two tables. I need to implement a query like this:

select parentOrder.Name,parenOrder.Amount ,childOrder.amount,childorder.Id
from
Orders  parentOrder inner join Orders childOrder on parentOrder.Id=childOrder.ParentOrder

But I have two questions:

  1. How do I join two tables specifically telling the columns on which they are to be joined

  2. How do I retrieve column values of the related table

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 21-Sep-2011 16:24:13   
  1. How do I join two tables specifically telling the columns on which they are to be joined

The CTor of the EntityRelation class lets you define these fields.

public EntityRelation( 
   IEntityField2 primaryKeyField,
   IEntityField2 foreignKeyField,
   RelationType typeOfRelation
)
  1. How do I retrieve column values of the related table

Use a DynamicList