Join view with table

Posts   
 
    
lgege
User
Posts: 27
Joined: 01-Sep-2005
# Posted on: 12-Jun-2006 15:39:07   

Hi,

Is it possible to join a view with a table? I am using Adapter.

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 12-Jun-2006 15:58:47   

Yes, use the LLBLGen Pro designer as follows: 1- First you should map the view to an Entity. 2- Then go to the entity's Edit/properties and on the relations tab you can define the custom relation , using one of the "Add new custom... relation" buttons. Please refer to the LLBLGen Pro manual "Using the designer -> Adding custom relations"

lgege
User
Posts: 27
Joined: 01-Sep-2005
# Posted on: 12-Jun-2006 16:04:36   

Is it possible to do it programmatically instead of designer? For example, I am using the following codes to join two tables without FK relations?

Dim rel As New EntityRelation(RelationType.ManyToMany) rel.AddEntityFieldPair(New Address().Fields(AddressFieldIndex.ZipCode), New ZipCode().Fields(ZipCodeFieldIndex.ZipCode)) rel.AddEntityFieldPair(New Address().Fields(AddressFieldIndex.City), New ZipCode().Fields(ZipCodeFieldIndex.City)) bucket.Relations.Add(rel, JoinHint.Inner)

I want to do something similar for the table/view join.

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Jun-2006 06:57:49   

The similar is possible, but first you will have to have the view mapped to an entity.

Then you just can treat it as an entity/table.