1 package fr.ifremer.reefdb.dao.data.measurement; 2 3 /* 4 * #%L 5 * Reef DB :: 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.quadrige3.core.dao.data.measurement.Measurement; 28 import fr.ifremer.reefdb.dto.data.measurement.MeasurementDTO; 29 30 import java.util.Collection; 31 import java.util.Date; 32 import java.util.List; 33 34 /** 35 * <p>ReefDbMeasurementDao interface.</p> 36 * 37 * @author Ludovic 38 */ 39 public interface ReefDbMeasurementDao { 40 41 /** 42 * <p>getMeasurementEntityBySurveyId.</p> 43 * 44 * @param surveyId a int. 45 * @param pmfmId a int. 46 * @param createIfNotExists a boolean. 47 * @return a {@link fr.ifremer.quadrige3.core.dao.data.measurement.Measurement} object. 48 */ 49 Measurement getMeasurementEntityBySurveyId(int surveyId, int pmfmId, boolean createIfNotExists); 50 51 /** 52 * <p>removeMeasurementBySurveyId.</p> 53 * 54 * @param surveyId a int. 55 * @param pmfmId a int. 56 */ 57 void removeMeasurementBySurveyId(int surveyId, int pmfmId); 58 59 /** 60 * <p>getMeasurementsBySurveyId.</p> 61 * 62 * @param surveyId a int. 63 * @param excludePmfmId a {@link java.lang.Integer} object. 64 * @return a {@link java.util.List} object. 65 */ 66 List<MeasurementDTO> getMeasurementsBySurveyId(int surveyId, Integer... excludePmfmId); 67 68 /** 69 * <p>getMeasurementsBySamplingOperationId.</p> 70 * 71 * @param samplingOperationId a int. 72 * @param withTaxonMeasurements a boolean. 73 * @param excludePmfmId a {@link java.lang.Integer} object. 74 * @return a {@link java.util.List} object. 75 */ 76 List<MeasurementDTO> getMeasurementsBySamplingOperationId(int samplingOperationId, boolean withTaxonMeasurements, Integer... excludePmfmId); 77 78 /** 79 * <p>saveMeasurementsBySurveyId.</p> 80 * 81 * @param surveyId a int. 82 * @param measurements a {@link java.util.Collection} object. 83 * @param excludePmfmId a {@link java.lang.Integer} object. 84 */ 85 void saveMeasurementsBySurveyId(int surveyId, Collection<MeasurementDTO> measurements, Integer... excludePmfmId); 86 87 /** 88 * <p>saveMeasurementsBySamplingOperationId.</p> 89 * 90 * @param samplingOperationId a int. 91 * @param measurements a {@link java.util.Collection} object. 92 * @param withIndividual a boolean. 93 * @param excludePmfmId a {@link java.lang.Integer} object. 94 */ 95 void saveMeasurementsBySamplingOperationId(int samplingOperationId, Collection<MeasurementDTO> measurements, boolean withIndividual, Integer... excludePmfmId); 96 97 /** 98 * Remove a list of measurement 99 * 100 * @param measurementIds a {@link java.util.Collection} object. 101 */ 102 void removeMeasurementsByIds(Collection<Integer> measurementIds); 103 104 /** 105 * Remove a list of individual measurements 106 * 107 * @param taxonMeasurementIds a {@link java.util.Collection} object. 108 */ 109 void removeTaxonMeasurementsByIds(Collection<Integer> taxonMeasurementIds); 110 111 /** 112 * <p>removeAllMeasurementsBySurveyId.</p> 113 * 114 * @param surveyId a int. 115 */ 116 void removeAllMeasurementsBySurveyId(int surveyId); 117 118 /** 119 * <p>removeAllMeasurementsBySamplingOperationId.</p> 120 * 121 * @param samplingOperationId a int. 122 */ 123 void removeAllMeasurementsBySamplingOperationId(int samplingOperationId); 124 125 /** 126 * Validate all measurements and taxon measurements attached to the survey and to the inner sampling operations 127 * 128 * @param surveyIds the survey id 129 */ 130 int validateAllMeasurementsBySurveyIds(Collection<Integer> surveyIds, Date validationDate); 131 132 /** 133 * Unvalidate all measurements and taxon measurements attached to the survey and to the inner sampling operations 134 * 135 * @param surveyIds the survey id 136 */ 137 int unvalidateAllMeasurementsBySurveyIds(Collection<Integer> surveyIds); 138 139 /** 140 * <p>updateMeasurementsControlDate.</p> 141 * 142 * @param controlledElementsPks a {@link java.util.Collection} object. 143 * @param controlDate a {@link java.util.Date} object. 144 */ 145 void updateMeasurementsControlDate(Collection<Integer> controlledElementsPks, Date controlDate); 146 147 /** 148 * <p>updateTaxonMeasurementsControlDate.</p> 149 * 150 * @param controlledElementsPks a {@link java.util.Collection} object. 151 * @param controlDate a {@link java.util.Date} object. 152 */ 153 void updateTaxonMeasurementsControlDate(Collection<Integer> controlledElementsPks, Date controlDate); 154 155 }