Class EntityTemplateTasks.LoadRelationsTask
java.lang.Object
ch.tocco.nice2.persist.entity.spi.template.EntityTemplateTasks.LoadRelationsTask
- All Implemented Interfaces:
OptionalTask<Multimap<String,
,String>, Multimap<RelationModel, Entity>> PersistTask<Multimap<String,
String>, Multimap<RelationModel, Entity>>
- Enclosing class:
EntityTemplateTasks
public static class EntityTemplateTasks.LoadRelationsTask
extends Object
implements OptionalTask<Multimap<String,String>,Multimap<RelationModel,Entity>>
A task that loads previously saved relation values for a template back into the template
entity. The relation data is given as a multimap from a relation model name (like
`relUser_status`) to a set of primary keys that denote the concrete entities that are the
targets for this relation.
The result is the same multimap structure, but the keys have been replaced by its corresponding
RelationModel
and the values by their corresponding Entity
s. If there is no
entity of given key, it is assumed to be removed and this case is silently ignored (no exception).-
Constructor Summary
ConstructorDescriptionLoadRelationsTask
(TemplateBlacklist templateBlacklist, EntityModel sourceModel) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
-
LoadRelationsTask
-
-
Method Details
-
doRun
public Multimap<RelationModel,Entity> doRun(Multimap<String, String> relations, CommandContext ctx) throws Exception- Specified by:
doRun
in interfaceOptionalTask<Multimap<String,
String>, Multimap<RelationModel, Entity>> - Throws:
Exception
-