Added sum() and abs().
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user