3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
;
12 import java
.io
.Serializable
;
13 import java
.util
.ArrayList
;
14 import java
.util
.HashSet
;
15 import java
.util
.List
;
18 import org
.apache
.log4j
.Logger
;
20 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
21 import eu
.etaxonomy
.cdm
.model
.common
.IIdentifiableEntity
;
24 * This class represents the result of a delete action.
30 public class DeleteResult
extends UpdateResult
{
32 @SuppressWarnings("unused")
33 private static final Logger logger
= Logger
.getLogger(DeleteResult
.class);
37 private final List
<Exception
> exceptions
= new ArrayList
<Exception
>();
39 private final Set
<CdmBase
> relatedObjects
= new HashSet
<CdmBase
>();
41 // private Set<PersistPair> objectsToDelete = new HashSet<PersistPair>();
43 // private Set<PersistPair> objectsToSave = new HashSet<DeleteResult.PersistPair>();
45 // protected class PersistPair{
46 // protected CdmBase objectToPersist;
47 // protected ICdmEntityDao<CdmBase> dao;
52 //***************************** GETTER /SETTER /ADDER *************************/
57 * Related objects that prevent the delete action to take place.
60 public Set
<CdmBase
> getRelatedObjects() {
61 return relatedObjects
;
63 public void addRelatedObject(CdmBase relatedObject
) {
64 this.relatedObjects
.add(relatedObject
);
66 public void addRelatedObjects(Set
<?
extends CdmBase
> relatedObjects
) {
67 this.relatedObjects
.addAll(relatedObjects
);