ObeyWeakRelations ignored in FetchTypedList?

Posts   
 
    
Koubessus
User
Posts: 28
Joined: 30-Dec-2004
# Posted on: 08-Nov-2005 17:16:14   

Hello.

I am still struggling with the upgrade to the new version (1.0.2004.1 -> 1.0.2005.1).

I have a created like this:


filter = new RelationPredicateBucket();
filter.Relations.ObeyWeakRelations = true;
filter.Relations.Add(WfProcessTaskEntity.Relations.WfProcessEntityUsingWfProcess);
filter.Relations.Add(WfProcessTaskEntity.Relations.SecGroupsEntityUsingAssignedGroup);
filter.Relations.Add(WfProcessTaskEntity.Relations.SecAdminEntityUsingAssignedUser);
filter.Relations.Add(WfProcessTaskEntity.Relations.WfProcessTaskStatusEntityUsingStatus);
filter.PredicateExpression.Add(PredicateFactory.CompareValue(Sinte.Scoring.DAL.WfProcessTaskFieldIndex.WfProcess,
                ComparisonOperator.Equal,Convert.ToInt32(Request.QueryString["id"])));

Only I am using dynamic list, i.e. custom created fields collection:

 adapter.FetchTypedList(fields, listData, filter, pageLength,  sort, true, null, pageNumber, pageLength);

The problem is that specifying ObeyWeakRelations = true does not produce OUTER JOIN select.

I went through all previous threads regarding ObeyWeakRelations and found out that if I add JoinHint.Left like this:

 filter.Relations.Add(WfProcessTaskEntity.Relations.SecGroupsEntityUsingAssignedGroup, JoinHint.Left);

I will get the desired result. But that does not solve my problem since I would have to go through all the existing code and check whether the relations are handled appropriately

Is there anything else I might have overlooked? I've already checked whether the relation is reported as a weak one...

Thanks for your replies,

Jakub

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Nov-2005 18:04:31   

You're right on time, I was about to sign off today's build, but will try to add a fix for this, IF it's an issue. Stay tuned.

(edit) Reproduced.

(edit) Fixed in next build.

Frans Bouma | Lead developer LLBLGen Pro
Koubessus
User
Posts: 28
Joined: 30-Dec-2004
# Posted on: 08-Nov-2005 18:21:03   

Otis wrote:

You're right on time, I was about to sign off today's build, but will try to add a fix for this, IF it's an issue. Stay tuned.

(edit) Reproduced.

Great! So it's not just me simple_smile

I've already went through runtime code and what struck me as odd is this:

in FetchTypedList(IEntityFields2 , DataTable , IRelationPredicateBucket filterBucket, int , ISortExpression , bool , IGroupByCollection , int , int )

you use passed IRelationPredicateBucket filterBucket only to copy Relations into RelationPredicateBucket filterToUse. But filterBucket is not used further in the code and the ObeyWeakRelations property is not copied into filterToUse.

Maybe this might help you somehow.

Jakub

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Nov-2005 18:33:42   

Koubessus wrote:

Otis wrote:

You're right on time, I was about to sign off today's build, but will try to add a fix for this, IF it's an issue. Stay tuned.

(edit) Reproduced.

Great! So it's not just me simple_smile

I've already went through runtime code and what struck me as odd is this:

in FetchTypedList(IEntityFields2 , DataTable , IRelationPredicateBucket filterBucket, int , ISortExpression , bool , IGroupByCollection , int , int )

you use passed IRelationPredicateBucket filterBucket only to copy Relations into RelationPredicateBucket filterToUse. But filterBucket is not used further in the code and the ObeyWeakRelations property is not copied into filterToUse.

That's exactly what's wrong indeed. There's a copy made because if hierarchy relations are added to the filter, it will add the relations to a filter which came from the outside, and which you probably want to re-use, which can have unforeseen consequences, so a copy is made and used further. Though as you examined correctly, the parameter wasn't carried on. I've fixed this now. All unittests and build scripts have now to be succesful and a new build will be uploaded simple_smile

(edit) fix is now available. (runtime libs)

Frans Bouma | Lead developer LLBLGen Pro