use of edu.harvard.iq.dataverse.Template in project dataverse by IQSS.
the class DeleteTemplateCommand method execute.
@Override
public Dataverse execute(CommandContext ctxt) throws CommandException {
Dataverse merged = ctxt.em().merge(editedDv);
if (!dvWDefaultTemplate.isEmpty()) {
for (Dataverse remove : dvWDefaultTemplate) {
remove.setDefaultTemplate(null);
ctxt.em().merge(remove);
}
}
Template doomedAndMerged = ctxt.em().merge(doomed);
ctxt.em().remove(doomedAndMerged);
return merged;
}