db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Allen <...@mojavelinux.com>
Subject Re: modified column
Date Thu, 13 Mar 2003 19:55:29 GMT
> > Is it at all possible to do something like:
> > 
> > add("(" + 2003 " - " + UserPeer.BORN + ")", 20);
> > 
> > to get people that are 20 years old?  Assume that the actually query
> > is more complicated and it is not as simple as just comparing the
> > year they were born, to 2003 - 20.  I am going for a concept here,
> > not a solution to this example.
> > 
> > Why can't a column be modified in the WHERE clause?  This makes it
> > inconvenient when doing conditions.  I would rather not have to
> > create a CUSTOM add() for this.
> criteria.add(UserPeer.BORN, 2003 - 20);
> 
> Or, if you wanted them at least 20 years old, it would be
> 
> criteria.add(UserPeer.BORN, 2003 - 20, Criteria.GREATER_EQUAL);
> 
> I'm trying to understand the general concept, but I don't think I get 
> it! :) Are you talking about a database-specific function? Could you 
> explain it again?

Exactly what I didn't want as an answer.   That was just a simple
example that has nothing to do what I am actually going to do.  Yes,
how do I run a function or modify the column database side.

I want to create a criteria where the database field is modified
before doing the comparison.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <dan@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"I'm old enough to know better, but still too young to care."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Mime
View raw message