Re: Qualifier With an Unexpected Empty Result
Re: Qualifier With an Unexpected Empty Result
- Subject: Re: Qualifier With an Unexpected Empty Result
- From: Kevin Hinkson <email@hidden>
- Date: Tue, 07 Apr 2015 19:25:29 -0400
Hi Ramsey,
The depth is correct because I was filtering a to-many relationship from another EO, but your other suggestion as to how to chain the dots worked.
Thanks.
> On Apr 7, 2015, at 7:11 PM, Ramsey Gurley <email@hidden> wrote:
>
> Does this make any difference?
>
> VariantCart.PARENT_VARIANT.dot(VariantInventory.PARENT_VARIANT).dot(VariantOrdered.PARENT_VARIANT).dot(VariantAvailable.PARENT_VARIANT).eq(availableVariant);
>
> The other thing I see is you are going up 4 here, not three as you did for availableVariant. Perhaps that should be:
>
> VariantCart.PARENT_VARIANT.dot(VariantInventory.PARENT_VARIANT).dot(VariantOrdered.PARENT_VARIANT).eq(availableVariant);
>
> ?
>
> On Apr 7, 2015, at 4:02 PM, Kevin Hinkson <email@hidden> wrote:
>
>> Hi,
>>
>> I’m not certain I will explain this question very well, but I’ll do my best.
>>
>> I am using single table inheritance for a group of objects. I also have items in the same table that relate to each other in a parent/child tree. I was attempting to filter up that parent/child tree all the way to the top using a qualifier so that I can find items in a to many relationship that have the same parent as the one I am starting with.
>>
>> Eg:
>> VariantCart variant = anAlreadyExistingEO;
>> VariantAvailable availableVariant = variant.parentVariant().parentVariant().parentVariant();
>> EOQualifier qualifier = VariantCart.PARENT_VARIANT.dot(VariantInventory.PARENT_VARIANT.dot(VariantOrdered.PARENT_VARIANT.dot(VariantAvailable.PARENT_VARIANT.eq(availableVariant))));
>>
>> Then apply said qualifier to a to-many relationship containing VariantCart EOs.
>>
>> This doesn’t work and it’s not clear to me why (I’m assuming it might be something to do with the inheritance filtering?). So while I’m fine walking up the tree manually and comparing each parent at the top instead of using a qualifier I was curious as to if anyone knew off the top of their head why that didn’t work.
>>
>> PS: hopefully I’m not abusing the .dot method — I’ve only recently started using that.
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden