• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple Search
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Search


  • Subject: Simple Search
  • From: David Holt <email@hidden>
  • Date: Fri, 14 Jul 2006 17:03:33 -0700

I am using DisplayGroups which make queries on individual attributes very easy.

I would like to provide a simple search where one text field returns a search on a concatenation of several attributes of the entity. I just tried putting the following code in my EO to try this concept out (title and author are attributes in the entity):

public String simpleSearch() {
          String author = author();
String title = title();

String simpleSearch;


        if ((author != null) && (!author.equals(""))) {
            simpleSearch = author + " " + title;
        }
        else {
            simpleSearch = title;
        }


        return simpleSearch;
    }

When I try and do a queryMatch on the simpleSearch field I get an error:
java.lang.IllegalStateException: sqlStringForKeyValueQualifier: attempt to generate SQL for com.webobjects.eocontrol.EOKeyValueQualifier (simpleSearch caseinsensitivelike '*test*') failed because attribute identified by key 'simpleSearch' was not reachable from from entity 'Document'

I assume this is because the attribute "simpleSearch" is not actually in the database. Is there a better strategy for searching concatenated fields using DisplayGroups?

Thanks,
David


 _______________________________________________
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

  • Follow-Ups:
    • Re: Simple Search
      • From: Chuck Hill <email@hidden>
    • Re: Simple Search
      • From: John Larson <email@hidden>
    • Re: Simple Search
      • From: Owen McKerrow <email@hidden>
  • Prev by Date: Re: WODisplayGroup.set[Global]DefaultStringMatchFormat
  • Next by Date: Re: How to create an action binding?
  • Previous by thread: Re: How to create an action binding?
  • Next by thread: Re: Simple Search
  • Index(es):
    • Date
    • Thread