View Javadoc
1   package fr.ifremer.tutti.persistence.service;
2   
3   /*
4    * #%L
5    * Tutti :: Persistence
6    * %%
7    * Copyright (C) 2012 - 2014 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the 
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public 
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
23   */
24  
25  import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
26  import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
27  import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
28  import org.springframework.transaction.annotation.Transactional;
29  
30  import java.util.Collection;
31  
32  /**
33   * CRUD of {@link MarineLitterBatch} entity.
34   *
35   * @author Tony Chemit - chemit@codelutin.com
36   * @since 0.3
37   */
38  @Transactional(readOnly = true)
39  public interface MarineLitterBatchPersistenceService extends TuttiPersistenceServiceImplementor {
40  
41      /**
42       * Get the batch parent of all root {@link MarineLitterBatch} for the given
43       * fishing operation.
44       *
45       * <strong>Note:</strong> All childs of the batch should be loaded here.
46       *
47       * @param fishingOperationId if of the fishing operation to seek
48       * @return the list of root {@link MarineLitterBatch}
49       * @since 1.3
50       */
51      BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(Integer fishingOperationId);
52  
53      @Transactional(readOnly = false)
54      MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean);
55  
56      @Transactional(readOnly = false)
57      Collection<MarineLitterBatch> createMarineLitterBatches(Integer fishingOperationId, Collection<MarineLitterBatch> beans);
58  
59      @Transactional(readOnly = false)
60      MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean);
61  
62      @Transactional(readOnly = false)
63      void deleteMarineLitterBatch(Integer id);
64  }