Added sum() and abs().

This commit is contained in:
Michael Bayne
2009-08-07 01:24:10 +00:00
parent 2ee38910c6
commit 0c7a8a5f01
+19
View File
@@ -21,6 +21,7 @@
package com.samskivert.depot; package com.samskivert.depot;
import com.samskivert.depot.expression.EpochSeconds; import com.samskivert.depot.expression.EpochSeconds;
import com.samskivert.depot.expression.FunctionExp;
import com.samskivert.depot.expression.IntervalExp; import com.samskivert.depot.expression.IntervalExp;
import com.samskivert.depot.expression.LiteralExp; import com.samskivert.depot.expression.LiteralExp;
import com.samskivert.depot.expression.SQLExpression; import com.samskivert.depot.expression.SQLExpression;
@@ -104,4 +105,22 @@ public class Exps
{ {
return new EpochSeconds(expr); return new EpochSeconds(expr);
} }
/**
* Creates an expression that computes the sum of the supplied expression. This would usually
* be used in a FieldOverride and supplied with a ColumnExp.
*/
public static FunctionExp sum (SQLExpression expr)
{
return new FunctionExp("sum", expr);
}
/**
* Creates an expression that computes the sum of the supplied expression. This would usually
* be used in a FieldOverride and supplied with a ColumnExp.
*/
public static FunctionExp abs (SQLExpression expr)
{
return new FunctionExp("abs", expr);
}
} }