On Mon, Mar 31, 2003 at 04:16:09PM -0700, Gary Eberhart wrote:
> Hello All,
> 
> When coding OJB queries you can code the following;
> 
> crit1.addLike("firstname", "%o%");
> crit1.addLike("lastname", "%m%");
> 
> 
> where firstname and lastname are the names of columns in the table.

first OJB tries to resolve firstname and lastname as properties of your
model class and replaces them by the column names you configured in your
repository.xml.

Only if no such properties are found (i.e. you do use column names to 
construct your criteria and those are different from your property names
or are not mapped at all) OJB assumes you are using column names and 
uses them directly to construct the sql statement.

So simply use the properties of your model class to construct criteria
and all you have to do when your column names change is to modify the
repository.

hth,
Jens

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to