Hi Dan

The age example seems simple.

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?

Eric

Dan Allen wrote:
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.

Dan



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



Reply via email to