Class GroupbyTask

java.lang.Object
ch.tocco.nice2.persist.core.api.exec.tasks2.GroupbyTask
All Implemented Interfaces:
OptionalTask<EntityList,com.google.common.collect.ImmutableMultimap<GroupbyTask.Key,Entity>>, PersistTask<EntityList,com.google.common.collect.ImmutableMultimap<GroupbyTask.Key,Entity>>

public final class GroupbyTask extends Object implements OptionalTask<EntityList,com.google.common.collect.ImmutableMultimap<GroupbyTask.Key,Entity>>
This task partitions a given entity list according to the result of resolving a path against each entity in the list. A path can "end in" an relation, like `relA.relB`, or in a field like `relA.unique_id` (a single field name is the simplest form). It returns a multi map where the key corresponds to the result of resolving the path against an entity in the list. Thus it is either an entity or the value of some field. The GroupbyTask.Key represents this: either one of GroupbyTask.Key.getEntity() or GroupbyTask.Key.getField() will be present. If the result is `null` then the special key GroupbyTask.Key.NULL is used.