You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Dan Bachelder <ch...@chowda.net> on 2001/10/28 23:23:21 UTC
Criteria and where clause
a criteria created like this:
crit = crit.or(LAST_NAME, (Object)keyword, Criteria.LIKE)
.or(FIRST_NAME, (Object)keyword, Criteria.LIKE)
.or(MIDDLE_I, (Object)keyword, Criteria.LIKE);
and keyword.equals("a") gives me the following where clause....
WHERE (CONTACT.LAST_NAME = 'a') AND (CONTACT.MIDDLE_I = 'a') AND
(CONTACT.FIRST_NAME = 'a')
what I want to see is:
WHERE (CONTACT.LAST_NAME LIKE '%a%') OR (CONTACT.MIDDLE_I LIKE '%a%') OR
(CONTACT.FIRST_NAME LIKE '%a%')
I assumed Criteria.or() use the OR logical operator instead of the AND... I
also assumed Criteria.LIKE would use the LIKE operator... where have I gone
wrong?
thanks,
dan
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: turbine path
Posted by Jason van Zyl <jv...@zenplex.com>.
On 10/30/01 3:18 PM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:
> "Nick Pomfret" <ni...@pixelpark.com> writes:
>
>> From inside one of the automatically generated 'om' classes, how can I
>> determine the absolute path that my turbine application is running in?
>
> ServletContext.getRealPath
You probably don't have access to RunData in your OM classes which means no
access a servlet context. You can use:
TurbineServlet.getRealPath(path)
which will access the ServletContext for you.
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
jvz.
Jason van Zyl
http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: turbine path
Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Nick Pomfret" <ni...@pixelpark.com> writes:
>>From inside one of the automatically generated 'om' classes, how can I
> determine the absolute path that my turbine application is running in?
ServletContext.getRealPath
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
turbine path
Posted by Nick Pomfret <ni...@pixelpark.com>.
>From inside one of the automatically generated 'om' classes, how can I
determine the absolute path that my turbine application is running in?
Nick
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Mac OS X
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Eric Daras <er...@dafriser.be> writes:
> Just a message to say that I am using Turbine on a IBook running Mac
> OS X 10.1 with MySQL as SGBD and It seems to work fine...
Thanks Eric, nice to hear about.
> Excuse the bad English
Your english is just fine.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Mac OS X
Posted by Eric Daras <er...@dafriser.be>.
Just a message to say that I am using Turbine on a IBook running Mac OS
X 10.1 with MySQL as SGBD and It seems to work fine...
Excuse the bad English
Eric
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Criteria and where clause
Posted by Dan Bachelder <ch...@chowda.net>.
this is how I hacked it... works now...
keyword = "%" + keyword + "%";
Criteria crit = new Criteria();
Criteria.Criterion criterion = null;
criterion = crit.getNewCriterion(FIRST_NAME, (Object)keyword, Criteria.LIKE)
.or(crit.getNewCriterion(LAST_NAME, (Object)keyword,
Criteria.LIKE))
.or(crit.getNewCriterion(MIDDLE_I, (Object)keyword,
Criteria.LIKE));
crit.and(criterion);
----- Original Message -----
From: "Dan Bachelder" <ch...@chowda.net>
To: <tu...@jakarta.apache.org>
Sent: Sunday, October 28, 2001 5:23 PM
Subject: Criteria and where clause
> a criteria created like this:
>
> crit = crit.or(LAST_NAME, (Object)keyword, Criteria.LIKE)
> .or(FIRST_NAME, (Object)keyword, Criteria.LIKE)
> .or(MIDDLE_I, (Object)keyword, Criteria.LIKE);
>
> and keyword.equals("a") gives me the following where clause....
>
> WHERE (CONTACT.LAST_NAME = 'a') AND (CONTACT.MIDDLE_I = 'a') AND
> (CONTACT.FIRST_NAME = 'a')
>
> what I want to see is:
>
> WHERE (CONTACT.LAST_NAME LIKE '%a%') OR (CONTACT.MIDDLE_I LIKE '%a%') OR
> (CONTACT.FIRST_NAME LIKE '%a%')
>
> I assumed Criteria.or() use the OR logical operator instead of the AND...
I
> also assumed Criteria.LIKE would use the LIKE operator... where have I
gone
> wrong?
>
> thanks,
> dan
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org