fix #5692: adapt delete algorithm to annotatedLineEditor mechanisms
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / annotatedlineeditor / IEntityPersistenceService.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.annotatedlineeditor;
12
13 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
14 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
15
16
17 /**
18 * Performs the retrieving and saving of a list of entities edited by a <code>ListEditor</code>,
19 * interacting with the persistence layer.
20 * <p>
21 * The methods' element input parameter is typically the <code>ListEditor</code>'s <code>IEditorInput</code>.
22 *
23 * @author p.ciardelli
24 * @created 07.07.2009
25 * @version 1.0
26 */
27 public interface IEntityPersistenceService<T> {
28
29 /**
30 * <p>create</p>
31 *
32 * @param entity a {@link java.lang.Object} object.
33 * @return a boolean.
34 */
35 T create(T entity);
36
37 /**
38 * <p>save</p>
39 *
40 * @param entity a {@link java.lang.Object} object.
41 * @return a boolean.
42 */
43 T save(T entity);
44
45 /**
46 * <p>merge</p>
47 *
48 * @param entity a {@link java.lang.Object} object.
49 * @param mergeTarget a {@link java.lang.Object} object.
50 * @return a boolean.
51 */
52 boolean merge(T entity, T mergeTarget);
53
54 /**
55 * <p>delete</p>
56 *
57 * @param entity a {@link java.lang.Object} object.
58 * @return a boolean.
59 * @throws ReferencedObjectUndeletableException
60 */
61 boolean delete(T entity, DeleteConfiguratorBase config) throws ReferencedObjectUndeletableException;
62 }