wildcard search and relationship traversal
wildcard search and relationship traversal
- Subject: wildcard search and relationship traversal
- From: Timmy <email@hidden>
- Date: Sun, 26 Mar 2006 11:47:23 -0800
WO folks:
background - I have a table ("job") that I have extended by adding a
one-to-one, owns destination relationship to another table
("jobDepartment" - for correlation to "department"). The reason is
long and sordid but it, for now, it makes sense to keep it as is. I
am forcing the creation of job.jobDepartment if it is null.
job <-> jobDepartment <<-> department
I have a problem when using this relationship in a wildcard search. I
have method to fetch a list of jobs based on user input to a single
field.
wildcard = searchField + "*"
To search for job EO's I build the following qualifiers to an array:
qualifiers.addObject(new EOKeyValueQualifier("field1",
EOQualifier.QualifierOperatorLike, wildcard));
qualifiers.addObject(new EOKeyValueQualifier("employee.field1",
EOQualifier.QualifierOperatorCaseInsensitiveLike, wildcard));
qualifiers.addObject(new EOKeyValueQualifier("employee.field2",
EOQualifier.QualifierOperatorCaseInsensitiveLike, wildcard));
If I execute a search on this everything works as planned and returns
the expected results searching by a related employee or etc. However,
when I add a qualifier which refers to the above mentioned
relationship, things break. That would look like this:
qualifiers.addObject(new EOKeyValueQualifier
("jobDepartment.department.field1",
EOQualifier.QualifierOperatorCaseInsensitiveLike, wildcard));
If jobDepartment.department.field1is null, the search fails even if
the criteria entered matches one of the earlier qualifiers that
previously worked. I'm hoping someone with more experience in EOF
than me knows why this is happening and how I might get around it.
Tim
_______________________________________________
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