FindMatches() and Relational Predicates

Posts   
 
    
Posts: 48
Joined: 26-Mar-2007
# Posted on: 26-Mar-2007 13:37:57   

v2.0.50727 Adapter

I am trying to filter my FindMatches call using a Relation Predicate but all I ever seem to get is an empty collection

Here is a sample of my failing code:

            RelationPredicateBucket bucket = new RelationPredicateBucket();
            bucket.Relations.Add(ParameterEntity.Relations.JobTypeParameterEntityUsingJobTypeParameterFk);
            bucket.PredicateExpression.Add(JobTypeParameterFields.Name == name);
            List<int> indexes = Parameters.FindMatches(bucket.PredicateExpression);
            if (indexes.Count > 0)
            {
                return Parameters[indexes[indexes.Count - 1]];
            }

where Parameters is a collection of ParameterEntity which references JobTypeParameterEntity

if I write my code like this then it works fine:

            foreach (ParameterEntity parameter in Parameters)
            {
                if (parameter.JobTypeParameter.Name == name)
                {
                    return parameter;
                }
            }

I guess I am doing something dumb

Thanks for any hints

--Sam

Aurelien avatar
Aurelien
Support Team
Posts: 162
Joined: 28-Jun-2006
# Posted on: 26-Mar-2007 14:38:39   

Hi,

The FindMatches method don't work with fields on related table.

I think you must fetch the entity collection with the bucket above.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 27-Mar-2007 10:10:38   

Hierarchical in-memory filters will be available in v2.1, which is currently in development. V2.0 doesn't have in-memory hierarchical filters.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 48
Joined: 26-Mar-2007
# Posted on: 27-Mar-2007 10:25:05   

Thanks guys!