Hi..
I have implemented a base class DataObject which encapsulates all the
functions required.. this serves as the base class for each of the class
representing a table in the database.. like findByPrimaryKey, delete..etc
However I want a search function in this base class which can find the
occurence of a string in any of the field in the dataobject.. for eg...
class DataObject DataObject findByPrimaryKey(Object primaryKey) {
this.load();
}
etc...
Person extends DataObject.. Person p; p.findByPrimaryKey("fasihuce"); // Get the details in p Vector ppl = p.search("fasih"); // Get the vector of all the Persons where // the string "fasih" appears in any of the column.. and this is // implemented in the base class like findByPrimaryKey
I could not figure out a way to find out how to query multiple fields in the base class...
I'm not sure if this is what you want, but I'm using a plain oql-query for *searching*:
SELECT o FROM dot.com.User o where firstName like $1 or lastName like $1 order by lastName, firstName
Stein
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
