WO folks:

I've implemented a wildcard search on one of my WOComponents by adding a bunch of EOKeyValueQualifiers to an array. The search takes user input, appends a "*" then I build the qualifiers as so:

qualifiers.addObject(new EOKeyValueQualifier("field1", EOQualifier.QualifierOperatorLike, wildcardMatch)); qualifiers.addObject(new EOKeyValueQualifier("relationship.field1", EOQualifier.QualifierOperatorCaseInsensitiveLike, wildcardMatch)); qualifiers.addObject(new EOKeyValueQualifier("relationship.field2", EOQualifier.QualifierOperatorCaseInsensitiveLike, wildcardMatch));

This all works as expected and returns any matching EO's. Something goes wrong when I add additional qualifiers that traverse two one-to- one relationships. I've extended a table in my model by adding adding another table and this relationship is set as "owns destination." So, if I add another qualifier like this:

qualifiers.addObject(new EOKeyValueQualifier("to-one-a.to-one- b.field1", EOQualifier.QualifierOperatorCaseInsensitiveLike, wildcardMatch));

my search returns results only if "to-one-b" is not null. This is true even if the user-entered criteria matches one of the first three qualifiers. If I comment the last qualifier out, the same search works again but I obviously lose the ability for the search to extend against the other relationship. One possible fix is to make sure that the final destination in the last qualifier is not null - but that is a user education approach.

Can anyone explain to me why this is happening?

Tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to