Typed List With Fields on Related Fields

Posts   
 
    
lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 14-Apr-2006 21:46:56   

EntitiesEntity entities = new EntitiesEntity(); IRelationPredicateBucket bucket = new RelationPredicateBucket(); IPredicateExpression ipe; ipe = ((EntitiesFields.Something == 111) & (EntitiesFields.Something2 == true)); bucket.PredicateExpression.Add(ipe); adapter.FetchTypedList(entities.Fields, dataTable, bucket, 0, null, false);

Everything works fine but the typed list doesnt include the "Fields on Related Fields". Is there a way to include those in a typed list fetch like this?

Thanks Matt

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 15-Apr-2006 02:47:03   

Could you include the related field in the typed list from its original entity? I belive you don't have access to the related field because it uses the entities relationship to the other entity, which would need to be filled with a prefetch. If you include all of the fields from their original entities in the typedlist then you won't have to worry about that.

lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 15-Apr-2006 04:31:04   

Im not sure how i could include it in the typed list fetch?

I could do something like:

ResultsetFields fields = new ResultsetFields(3); fields.DefineField(SomethingEntityFieldIndex.FieldId, 0, "FieldId");

But the problem is i have a table with multiple foreign keys refrencing the same table. So it would end up with:

ResultsetFields fields = new ResultsetFields(3); fields.DefineField(SomethingEntityFieldIndex.FieldId, 0, "FieldId"); fields.DefineField(SomethingEntityFieldIndex.FieldId, 1, "FieldId");

Is there a way to specify which table relation to use?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 15-Apr-2006 12:05:52   

Yes, there are overloads which let you specify the object alias to use. You can specify the alias for each entity in the typedlist designer or you can specify the alias for the entity in the relationcollection.Add() method overload you use when you add a relation.

Frans Bouma | Lead developer LLBLGen Pro