Class AggregateTasks.Sum
java.lang.Object
ch.tocco.nice2.persist.core.api.exec.tasks2.AggregateTasks.Sum
- All Implemented Interfaces:
OptionalTask<Iterable<Entity>,
,BigDecimal> PersistTask<Iterable<Entity>,
,BigDecimal> AggregateTasks.AggregateTask<BigDecimal>
- Enclosing class:
AggregateTasks
public static class AggregateTasks.Sum
extends Object
implements OptionalTask<Iterable<Entity>,BigDecimal>, AggregateTasks.AggregateTask<BigDecimal>
Calculates the sum of the values returned when resolving the given
path against each entity of the entity list.
The path must denote a numeric field or end in a relation. For the latter
case it sums up the relation targets. If the path is empty, it is the same
as
count
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondoRun
(Iterable<Entity> list, CommandContext ctx) static PersistTask
<EntityList, BigDecimal> fromEntityList
(Path path) static PersistTask
<EntityList, BigDecimal> fromEntityList
(String path) static AggregateTasks.Sum
fromIterable
(Path path) static AggregateTasks.Sum
fromIterable
(String path) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.exec.OptionalTask
run
Methods inherited from interface ch.tocco.nice2.persist.core.api.exec.PersistTask
andThenDo, compose, compose2, composeWhen, discardResult, expand, expand, getDescription, ifElse, orWhen, orWhenNot, passWhen, passWhenNot, skipErrors, unwrap
-
Constructor Details
-
Sum
-
Sum
-
-
Method Details
-
fromEntityList
-
fromIterable
-
fromEntityList
-
fromIterable
-
doRun
- Specified by:
doRun
in interfaceOptionalTask<Iterable<Entity>,
BigDecimal> - Throws:
Exception
-
fromEntityList
- Specified by:
fromEntityList
in interfaceAggregateTasks.AggregateTask<BigDecimal>
-
toString
-