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 27 import fr.ifremer.dali.dto.referential.pmfm.FractionDTO; 28 import org.springframework.cache.annotation.Cacheable; 29 30 import java.util.List; 31 32 /** 33 * Created by Ludovic on 29/07/2015. 34 */ 35 public interface DaliFractionDao { 36 37 /** Constant <code>FRACTION_BY_ID_CACHE="fractionById"</code> */ 38 String FRACTION_BY_ID_CACHE = "fraction_by_id"; 39 /** Constant <code>FRACTIONS_BY_MATRIX_ID_CACHE="fractionsByMatrixId"</code> */ 40 String FRACTIONS_BY_MATRIX_ID_CACHE = "fractions_by_matrix_id"; 41 /** Constant <code>ALL_FRACTIONS_CACHE="allFractions"</code> */ 42 String ALL_FRACTIONS_CACHE = "all_fractions"; 43 44 /** 45 * <p>getAllFractions.</p> 46 * 47 * @param statusCodes a {@link java.util.List} object. 48 * @return a {@link java.util.List} object. 49 */ 50 @Cacheable(value = ALL_FRACTIONS_CACHE) 51 List<FractionDTO> getAllFractions(List<String> statusCodes); 52 53 /** 54 * <p>getFractionById.</p> 55 * 56 * @param fractionId a int. 57 * @return a {@link fr.ifremer.dali.dto.referential.pmfm.FractionDTO} object. 58 */ 59 @Cacheable(value = FRACTION_BY_ID_CACHE) 60 FractionDTO getFractionById(int fractionId); 61 62 /** 63 * <p>getFractionsByMatrixId.</p> 64 * 65 * @param matrixId a {@link java.lang.Integer} object. 66 * @return a {@link java.util.List} object. 67 */ 68 @Cacheable(value = FRACTIONS_BY_MATRIX_ID_CACHE) 69 List<FractionDTO> getFractionsByMatrixId(Integer matrixId); 70 71 /** 72 * <p>findFractions.</p> 73 * 74 * @param fractionId a {@link java.lang.Integer} object. 75 * @param statusCodes a {@link java.util.List} object. 76 * @return a {@link java.util.List} object. 77 */ 78 List<FractionDTO> findFractions(Integer fractionId, List<String> statusCodes); 79 80 }