Entity.SomeRelatedCollection.GetMulti(filter) question

Posts   
 
    
benles
User
Posts: 62
Joined: 02-May-2005
# Posted on: 17-Jun-2005 01:32:27   

Will Entity.SomeRelatedCollection.GetMulti(filter) apply the filter only to the items already related to the entity, or does the filter override the implied relationship filter?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 17-Jun-2005 09:36:14   

It will fetch all entities using the filter specified, thus will not use an additional filter related to 'entity'.

Frans Bouma | Lead developer LLBLGen Pro
junior882
User
Posts: 13
Joined: 26-Apr-2005
# Posted on: 09-Sep-2005 00:17:39   

Otis wrote:

It will fetch all entities using the filter specified, thus will not use an additional filter related to 'entity'.

Kind of a newbie, so bear with me. How would you go about applying a filter to the related collection?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Sep-2005 09:50:03   

junior882 wrote:

Otis wrote:

It will fetch all entities using the filter specified, thus will not use an additional filter related to 'entity'.

Kind of a newbie, so bear with me. How would you go about applying a filter to the related collection?

entity.SomeCollection, like customer.Orders, is filled with the filter based on the relation between the two, in my example customer and order. So if I want all customer's orders, I call customer.Orders. If I want all customer's orders for a particular date range, I call customer.GetMultiOrders() with the overload which accepts an additional filter.

Please consult the reference manual in the llblgen pro folder for details on these methods.

Frans Bouma | Lead developer LLBLGen Pro
junior882
User
Posts: 13
Joined: 26-Apr-2005
# Posted on: 09-Sep-2005 16:42:17   

Otis wrote:

junior882 wrote:

Otis wrote:

It will fetch all entities using the filter specified, thus will not use an additional filter related to 'entity'.

Kind of a newbie, so bear with me. How would you go about applying a filter to the related collection?

entity.SomeCollection, like customer.Orders, is filled with the filter based on the relation between the two, in my example customer and order. So if I want all customer's orders, I call customer.Orders. If I want all customer's orders for a particular date range, I call customer.GetMultiOrders() with the overload which accepts an additional filter.

Please consult the reference manual in the llblgen pro folder for details on these methods.

Hmm. When I call that method, I do not see an overload to accept an additional filter. I only have 2 overloads....One takes forceFetch and the other has forceFetch and entityFactoryToUse. cry

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Sep-2005 16:45:10   

It is available in 1.0.2004.2, perhaps you're using an older version? The method is located in the parent entity, so GetMultiOrders is located in CustomerEntityBase.

Frans Bouma | Lead developer LLBLGen Pro
junior882
User
Posts: 13
Joined: 26-Apr-2005
# Posted on: 09-Sep-2005 17:02:21   

Otis wrote:

It is available in 1.0.2004.2, perhaps you're using an older version? The method is located in the parent entity, so GetMultiOrders is located in CustomerEntityBase.

Ok, I am using 1.0.2004.2. Here's my situation....


Dim Case as New CaseEntity(PK)
Dim People as New PeopleCollection = Case.GetMultiPeopleCollectionViaAssocIntPeople( )

The GetMultiPeopleCollectionViaAssocIntPeople method only has (forceFetch) and (forceFetch, entityFactoryToUse). Anyway, thanks for any help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Sep-2005 17:47:59   

aha! that's a m:n relation. Sorry, I was talking about an 1:n relation. flushed

I should have thought about that.

Frans Bouma | Lead developer LLBLGen Pro