Revision 9dab9096
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImpl.java | ||
---|---|---|
22 | 22 |
import org.springframework.transaction.annotation.Transactional; |
23 | 23 |
|
24 | 24 |
import eu.etaxonomy.cdm.api.application.CdmRepository; |
25 |
import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator; |
|
25 | 26 |
import eu.etaxonomy.cdm.model.common.VersionableEntity; |
26 | 27 |
import eu.etaxonomy.cdm.model.name.Registration; |
27 | 28 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
... | ... | |
38 | 39 |
import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationDTO; |
39 | 40 |
import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationWorkingSetDTO; |
40 | 41 |
import eu.etaxonomy.cdm.vaadin.util.converter.TypeDesignationSetManager.TypeDesignationWorkingSet; |
42 |
import eu.etaxonomy.cdm.vaadin.view.name.stdDTOs; |
|
41 | 43 |
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO; |
42 | 44 |
|
43 | 45 |
/** |
... | ... | |
162 | 164 |
// regAnalyzer.printCopyEntities(System.out); |
163 | 165 |
|
164 | 166 |
session.merge(dto.getOwner()); |
167 |
session.flush(); |
|
168 |
|
|
169 |
// ------------------------ perform delete of removed SpecimenTypeDesignations |
|
170 |
SpecimenDeleteConfigurator specimenDeleteConfigurer = new SpecimenDeleteConfigurator(); |
|
171 |
specimenDeleteConfigurer.setDeleteChildren(false); |
|
172 |
specimenDeleteConfigurer.setDeleteFromDescription(true); |
|
173 |
specimenDeleteConfigurer.setDeleteFromIndividualsAssociation(true); |
|
174 |
specimenDeleteConfigurer.setDeleteFromTypeDesignation(true); |
|
175 |
specimenDeleteConfigurer.setDeleteMolecularData(true); |
|
176 |
|
|
177 |
for(SpecimenTypeDesignation std : dto.deletedSpecimenTypeDesignations()){ |
|
178 |
DerivedUnit du = std.getTypeSpecimen(); |
|
179 |
du.removeSpecimenTypeDesignation(std); |
|
180 |
DerivationEvent derivationEvent = du.getDerivedFrom(); |
|
181 |
derivationEvent.removeDerivative(du); |
|
182 |
repo.getNameService().deleteTypeDesignation(dto.getTypifiedName(), std); |
|
183 |
repo.getOccurrenceService().delete(du, specimenDeleteConfigurer); |
|
184 |
// if(derivationEvent.getDerivatives().size() == 0){ |
|
185 |
// getRepo().getEventBaseService().delete(derivationEvent); |
|
186 |
// } |
|
187 |
} |
|
188 |
// ------------------------- |
|
165 | 189 |
|
166 | 190 |
|
167 |
session.flush(); |
|
168 | 191 |
} |
169 | 192 |
|
170 | 193 |
|
... | ... | |
231 | 254 |
return addCandidates; |
232 | 255 |
} |
233 | 256 |
|
257 |
/** |
|
258 |
* {@inheritDoc} |
|
259 |
*/ |
|
260 |
@Override |
|
261 |
public void delete(SpecimenTypeDesignationWorkingSetDTO bean) { |
|
262 |
for(stdDTOs : bean.getSpecimenTypeDesignationDTOs()){ |
|
263 |
|
|
264 |
} |
|
265 |
|
|
266 |
} |
|
267 |
|
|
234 | 268 |
} |
Also available in: Unified diff
moving bussiness logic from presenter into DTO Service