Merge branch 'release/5.19.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / annotatedlineeditor / IEntityPersistenceService.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.taxeditor.annotatedlineeditor;
10
11 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
12 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
13
14 /**
15 * Performs the retrieving and saving of a list of entities edited by a <code>ListEditor</code>,
16 * interacting with the persistence layer.
17 * <p>
18 * The methods' element input parameter is typically the <code>ListEditor</code>'s <code>IEditorInput</code>.
19 *
20 * @author p.ciardelli
21 * @created 07.07.2009
22 */
23 public interface IEntityPersistenceService<T> {
24
25 /**
26 * <p>create</p>
27 * @return a boolean.
28 */
29 public T create(T entity);
30
31 /**
32 * <p>save</p>
33 *
34 * @param entity a {@link java.lang.Object} object.
35 * @return a boolean.
36 */
37 public T save(T entity);
38
39 /**
40 * <p>merge</p>
41 *
42 * @param entity a {@link java.lang.Object} object.
43 * @param mergeTarget a {@link java.lang.Object} object.
44 * @return a boolean.
45 */
46 public boolean merge(T entity, T mergeTarget);
47
48 /**
49 * <p>delete</p>
50 *
51 * @param entity a {@link java.lang.Object} object.
52 * @return a boolean.
53 * @throws ReferencedObjectUndeletableException
54 */
55 public boolean delete(T entity, DeleteConfiguratorBase config) throws ReferencedObjectUndeletableException;
56 }