defining relations

Posts   
 
    
Posts: 3
Joined: 10-Jun-2010
# Posted on: 10-Jun-2010 12:40:45   

i hav a problem with using relations with llblgenpro. the following is the query, pls help me in how to do it with llblgenpro.

query:

select fields ** from table1 ** right join table2 ** on ** [join condition] left join table3 inner join table 4 ** on [join condition]** on** [join condition] left join table5 on [join condition]** where condition

Pls. help me.......

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 10-Jun-2010 17:31:20   

Are you trying to define these relations in the LLBLGen designer or in code ? Have you read the documentation about both of these...?

http://www.llblgen.com/documentation/2.6/Using%20the%20designer/designer_customrelations.htm

http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/Adapter/Using%20TypedViews,%20TypedLists%20and%20Dynamic%20Lists/gencode_usingdynamiclists_adapter.htm

Assuming you have the correct PK-FK relationships set up in you database, most Relations will be created for you.

Matt

Posts: 3
Joined: 10-Jun-2010
# Posted on: 11-Jun-2010 07:35:40   

am trying to do this using code. my problem is how to generate the following query in llblgen

select fields from table1 right join table2 on [join condition] **left join table3 inner join table 4 **on [join condition] on [join condition] left join table5 on [join condition] where condition

i want to define the part of query which is marked as block. pls. help me.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-Jun-2010 08:19:22   

Please check Multi-entity filters

Posts: 3
Joined: 10-Jun-2010
# Posted on: 11-Jun-2010 08:57:53   

thanks for ur response..... but... its abt adding a custom filter on join.... but i want to add join on another join....

select fields from table1 right join table2 on [join condition] left join table3 inner join table 4 on [join condition] on [join condition] left join table5 on [join condition] where condition

help me

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-Jun-2010 10:11:55   

thanks for ur response..... but... its abt adding a custom filter on join

I think you have looked at the next paragraph, please read the previous paragraph titled "Multi-entity filters".

Anyway all you have to do is to add the relations you want to the relationCollection passed to the fetch method.

Also there is an overload for the RelationCollection.Add() which accepts a JoinHint. Possible options are:

None
Inner
Left
Right
Cross