Class CascadeDeleteTask
java.lang.Object
ch.tocco.nice2.persist.entity.api.cascadingdelete.CascadeDeleteTask
- All Implemented Interfaces:
OptionalTask<EntityList,
,List<EntityId>> PersistTask<EntityList,
,List<EntityId>> CascadeCommons
public final class CascadeDeleteTask
extends Object
implements OptionalTask<EntityList,List<EntityId>>, CascadeCommons
Persist task that performs cascading delete of an entity.
The `map` argument is of type
<EntityModel-Name> --> List<PrimaryKey>
and specifies all entities that should not be deleted.
The businessUnits
argument lists all business unit (ids) that are changed into
when deleting entities. If this is not specified, then all existing business units
are iterated through, such that all related entities, no matter which business unit,
are removed.-
Field Summary
Fields inherited from interface ch.tocco.nice2.persist.entity.api.cascadingdelete.CascadeCommons
allBusinessUnits, noBusinessUnit
-
Constructor Summary
ConstructorDescriptionCascadeDeleteTask
(CascadingDelete cascadingDelete, BusinessUnitManager businessUnitManager, Map<String, String[]> map) CascadeDeleteTask
(CascadingDelete cascadingDelete, BusinessUnitManager businessUnitManager, Map<String, String[]> map, boolean continueOnCascadeException) CascadeDeleteTask
(CascadingDelete cascadingDelete, BusinessUnitManager businessUnitManager, Map<String, String[]> map, Iterable<String> businessUnits, boolean continueOnCascadeException) Constructor allows to specify a list of business units to use, instead of applying this to all. -
Method Summary
Modifier and TypeMethodDescriptiondoRun
(EntityList list, CommandContext ctx) toString()
withAllBusinessUnits
(Iterable<String> bus, DeletionSet set, CommandContext ctx) 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
-
CascadeDeleteTask
public CascadeDeleteTask(CascadingDelete cascadingDelete, BusinessUnitManager businessUnitManager, Map<String, String[]> map) -
CascadeDeleteTask
public CascadeDeleteTask(CascadingDelete cascadingDelete, BusinessUnitManager businessUnitManager, Map<String, String[]> map, boolean continueOnCascadeException) -
CascadeDeleteTask
public CascadeDeleteTask(CascadingDelete cascadingDelete, BusinessUnitManager businessUnitManager, Map<String, String[]> map, Iterable<String> businessUnits, boolean continueOnCascadeException) Constructor allows to specify a list of business units to use, instead of applying this to all.
-
-
Method Details
-
doRun
- Specified by:
doRun
in interfaceOptionalTask<EntityList,
List<EntityId>> - Throws:
Exception
-
withAllBusinessUnits
public List<EntityId> withAllBusinessUnits(Iterable<String> bus, DeletionSet set, CommandContext ctx) throws Exception - Throws:
Exception
-
toString
-