View Javadoc
1   package fr.ifremer.dali.dao.referential.pmfm;
2   
3   /*
4    * #%L
5    * Dali :: Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import fr.ifremer.dali.dto.referential.pmfm.PmfmDTO;
27  import org.springframework.cache.annotation.Cacheable;
28  
29  import java.util.Collection;
30  import java.util.List;
31  
32  /**
33   * <p>DaliPmfmDao interface.</p>
34   *
35   */
36  public interface DaliPmfmDao {
37  
38      /** Constant <code>ALL_PMFMS_CACHE="allPmfms"</code> */
39      String ALL_PMFMS_CACHE = "all_pmfms";
40      /** Constant <code>PMFM_BY_ID_CACHE="pmfmById"</code> */
41      String PMFM_BY_ID_CACHE = "pmfm_by_id";
42      /** Constant <code>PMFMS_BY_IDS_CACHE="pmfmsByIds"</code> */
43      String PMFMS_BY_IDS_CACHE = "pmfms_by_ids";
44      String PMFMS_BY_CRITERIA_CACHE = "pmfms_by_criteria";
45  
46      /**
47       * <p>getAllPmfms.</p>
48       *
49       * @param statusCodes a {@link java.util.List} object.
50       * @return a {@link java.util.List} object.
51       */
52      @Cacheable(value = ALL_PMFMS_CACHE)
53      List<PmfmDTO> getAllPmfms(List<String> statusCodes);
54  
55      /**
56       * <p>getPmfmById.</p>
57       *
58       * @param pmfmId a int.
59       * @return a {@link fr.ifremer.dali.dto.referential.pmfm.PmfmDTO} object.
60       */
61      @Cacheable(value = PMFM_BY_ID_CACHE)
62      PmfmDTO getPmfmById(int pmfmId);
63  
64      /**
65       * <p>getPmfmsByIds.</p>
66       *
67       * @param pmfmIds a {@link List} object.
68       * @return a {@link java.util.List} object.
69       */
70      @Cacheable(value = PMFMS_BY_IDS_CACHE)
71      List<PmfmDTO> getPmfmsByIds(Collection<Integer> pmfmIds);
72  
73      /**
74       * <p>findPmfms.</p>
75       *
76       * @param parameterCode a {@link String} object.
77       * @param matrixId a {@link Integer} object.
78       * @param fractionId a {@link Integer} object.
79       * @param methodId a {@link Integer} object.
80       * @param unitId
81       * @param pmfmName a {@link String} object.
82       * @param statusCodes a {@link List} object.
83       * @return a {@link java.util.List} object.
84       */
85      @Cacheable(value = PMFMS_BY_CRITERIA_CACHE)
86      List<PmfmDTO> findPmfms(String parameterCode, Integer matrixId, Integer fractionId, Integer methodId, Integer unitId, String pmfmName, List<String> statusCodes);
87  
88  }