Assuming that you have a supplier object, it would look like:

(I haven't run this through a compiler, but it basically should be:)

Criteria crit = new Criteria();
crit.add(SupplierPeer.ASSIGNMENTCAPACITY,
(Object)"(SUPPLIER.assignmentCapacity - SUPPLIER.actualAssignments) >
0", Criteria.CUSTOM);

Also look in the Criteria HOW-TO under Custom Criteria for more info....

Note:  If you leave off the (Object) cast in the middle, you'll get an
Ambiguous function call from the Java compiler.  

HTH
-Peter
On Tue, 2002-10-15 at 22:28, [EMAIL PROTECTED] wrote:
> I'd like to write a criteria that subtracts two columns and then checks to
> see if the result is greater than zero.  The SQL would look something like
> this
> 
> select * from supplier where (assignmentCapacity - actualAssignments) > 0
> 
> Has anyone done something similar to this?  Any ideas?  Thanks!
> -Mike
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>

Reply via email to