Revision 0453b64d
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingSetServiceImpl.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.api.application.CdmRepository; |
25 | 25 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
26 | 26 |
import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator; |
27 |
import eu.etaxonomy.cdm.debug.PersistentContextAnalyzer; |
|
27 | 28 |
import eu.etaxonomy.cdm.model.common.VersionableEntity; |
28 | 29 |
import eu.etaxonomy.cdm.model.name.Registration; |
29 | 30 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
... | ... | |
168 | 169 |
|
169 | 170 |
Session session = repo.getSession(); |
170 | 171 |
|
171 |
// PersistentContextAnalyzer regAnalyzer = new PersistentContextAnalyzer(dto.getOwner(), session);
|
|
172 |
// regAnalyzer.printEntityGraph(System.out);
|
|
173 |
// regAnalyzer.printCopyEntities(System.out);
|
|
172 |
PersistentContextAnalyzer regAnalyzer = new PersistentContextAnalyzer(dto.getOwner(), session); |
|
173 |
regAnalyzer.printEntityGraph(System.out); |
|
174 |
regAnalyzer.printCopyEntities(System.out); |
|
174 | 175 |
|
175 | 176 |
session.merge(dto.getOwner()); |
176 | 177 |
session.flush(); |
... | ... | |
180 | 181 |
deleteSpecimenTypeDesignation(dto, std); |
181 | 182 |
} |
182 | 183 |
session.flush(); |
183 |
|
|
184 | 184 |
} |
185 | 185 |
|
186 | 186 |
|
... | ... | |
193 | 193 |
*/ |
194 | 194 |
protected void deleteSpecimenTypeDesignation(SpecimenTypeDesignationWorkingSetDTO<? extends VersionableEntity> dto, SpecimenTypeDesignation std) { |
195 | 195 |
|
196 |
if(dto.getOwner() instanceof Registration){ |
|
197 |
Registration registration = (Registration) dto.getOwner(); |
|
198 |
registration.getTypeDesignations().clear(); |
|
199 |
repo.getRegistrationService().save(registration); |
|
200 |
} else { |
|
201 |
throw new RuntimeException("Unimplemented owner type"); |
|
202 |
} |
|
196 |
// if(dto.getOwner() instanceof Registration){
|
|
197 |
// Registration registration = (Registration) dto.getOwner();
|
|
198 |
// registration.getTypeDesignations().clear();
|
|
199 |
// repo.getRegistrationService().save(registration);
|
|
200 |
// } else {
|
|
201 |
// throw new RuntimeException("Unimplemented owner type");
|
|
202 |
// }
|
|
203 | 203 |
DerivedUnit du = std.getTypeSpecimen(); |
204 |
DerivationEvent derivationEvent = du.getDerivedFrom(); |
|
204 |
// DerivationEvent derivationEvent = du.getDerivedFrom();
|
|
205 | 205 |
|
206 | 206 |
//du.removeSpecimenTypeDesignation(std); |
207 | 207 |
//derivationEvent.removeDerivative(du); |
Also available in: Unified diff
ref #7103 fixing test setup and data for SpecimenTypeDesignationWorkingSetServiceImplTest