cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Armstrong <>
Subject Internal row comparison in ExpressionFactory
Date Thu, 26 Mar 2009 16:55:03 GMT
Hi, I need to do a selection on a table partially based on comparing
two elements
of that table. Basically a 'total' and a 'current' where total is a
changing value and needs to be compared to current to see if the row
is valid. Its a floating license system for an app I am building.

This obviously does not work since it expects a numeric, not a string,
in the value:

Expression qual = ExpressionFactory.likeIgnoreCaseExp(



How can I get to to generate SQL like this :

SELECT t0.license, t0.code, t0.licensetype, t0.product,,
t0.validfrom, t0.totalunits, t0.user, t0.validto, t0.datecreated,
t0.claimedunits FROM license t0 WHERE (UPPER(t0.code) LIKE
UPPER('7GEN-BTPTDF')) AND (t0.claimedunits < t0.totalunits);

How would I structure an Expression so that it does an internal
comparison. I know an SQLTemplate can do it, is this one of those
times that ExpressionFactory is not really suited to the task?


View raw message