This is an automated email from the git hooks/post-receive script. New commit to branch feature/6417 in repository tutti. See http://git.codelutin.com/tutti.git commit abb7b4ed43b675b9f6622f333bc0728e13a3066a Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Jan 9 07:55:03 2015 +0100 suppresion de PmfmId2 et renommage ID_PSFM en ID_PMFM --- .../adagio/core/dao/referential/pmfm/PmfmId2.java | 190 --------------------- .../AccidentalBatchPersistenceServiceImpl.java | 5 +- .../CaracteristicPersistenceServiceImpl.java | 5 +- 3 files changed, 4 insertions(+), 196 deletions(-) diff --git a/tutti-persistence/src/main/java/fr/ifremer/adagio/core/dao/referential/pmfm/PmfmId2.java b/tutti-persistence/src/main/java/fr/ifremer/adagio/core/dao/referential/pmfm/PmfmId2.java deleted file mode 100644 index 173900e..0000000 --- a/tutti-persistence/src/main/java/fr/ifremer/adagio/core/dao/referential/pmfm/PmfmId2.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * #%L - * Tutti :: Persistence - * %% - * Copyright (C) 2012 - 2014 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package fr.ifremer.adagio.core.dao.referential.pmfm; - -import fr.ifremer.adagio.core.dao.technical.AdagioEnumerationDef; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import static org.nuiton.i18n.I18n.n; - -public enum PmfmId2 implements Serializable, AdagioEnumerationDef<Integer> { - - // NEW FOR TUTTI # PSFM "Pour référencer un autre id de pmfm" - ID_PSFM( - "adagio.enumeration.PmfmId.ID_PSFM", - n("adagio.enumeration.PmfmId.ID_PSFM.description"), - 1433); - - /** - * The serial version UID of this class. Needed for serialization. - */ - private static final long serialVersionUID = 1L; - - private String key; - - private String description; - - private Integer enumValue; - - private PmfmId2(String key, String description, Integer value) { - this.key = key; - this.description = description; - this.enumValue = value; - } - - @Override - public void setValue(Integer newValue) { - if (newValue != null && !this.enumValue.equals(newValue)) { - // Update static lists - values.remove(this.enumValue); - literals.remove(this.enumValue); - this.enumValue = newValue; - values.put(this.enumValue, this); - literals.add(this.enumValue); - } - } - - @Override - public String getValueAsString() { - return String.valueOf(this.enumValue); - } - - /** - * Retrieves an instance of PmfmId from <code>its name</code>. - * - * @param name the name to create the PmfmId from. - * @return The enumeration literal named after the 'name' argument - */ - public static PmfmId2 fromString(String name) { - return PmfmId2.valueOf(name); - } - - /** - * Returns an enumeration literal String <code>value</code>. - * Required by JAXB2 enumeration implementation - * - * @return String with corresponding value - */ - public Integer value() { - return this.enumValue; - } - - /** - * Returns an instance of PmfmId from String <code>value</code>. - * Required by JAXB2 enumeration implementation - * - * @param value the value to create the PmfmId from. - * @return static Enumeration with corresponding value - */ - public static PmfmId2 fromValue(String value) { - for (PmfmId2 enumName : PmfmId2.values()) { - if (enumName.getValue().equals(value)) { - return enumName; - } - } - throw new IllegalArgumentException("PmfmId.fromValue(" + value + ')'); - } - - /** - * Gets the underlying value of this type safe enumeration. - * This method is necessary to comply with DaoBase implementation. - * - * @return The name of this literal. - */ - public Integer getValue() { - return this.enumValue; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public String getKey() { - return key; - } - - @Override - public Class<?> getType() { - return String.class; - } - - /** - * Returns an unmodifiable list containing the literals that are known by this enumeration. - * - * @return A List containing the actual literals defined by this enumeration, this list - * can not be modified. - */ - public static List<Integer> literals() { - return PmfmId2.literals; - } - - /** - * Returns an unmodifiable list containing the names of the literals that are known - * by this enumeration. - * - * @return A List containing the actual names of the literals defined by this - * enumeration, this list can not be modified. - */ - public static List<String> names() { - return PmfmId2.names; - } - - private static final Map<Integer, PmfmId2> values = new LinkedHashMap<Integer, PmfmId2>(33, 1); - - private static final List<Integer> literals = new ArrayList<Integer>(33); - - private static List<String> names = new ArrayList<String>(33); - - private static final List<PmfmId2> valueList = new ArrayList<PmfmId2>(33); - - /** - * Initializes the values. - */ - static { - synchronized (PmfmId2.values) { - PmfmId2.values.put(ID_PSFM.enumValue, ID_PSFM); - } - synchronized (PmfmId2.valueList) { - PmfmId2.valueList.add(ID_PSFM); - // For Adagio, lists could be reload from configuration - // PmfmId.valueList = Collections.unmodifiableList(valueList); - } - synchronized (PmfmId2.literals) { - PmfmId2.literals.add(ID_PSFM.enumValue); - // For Adagio, lists could be reload from configuration - // PmfmId.literals = Collections.unmodifiableList(literals); - } - synchronized (PmfmId2.names) { - PmfmId2.names.add("ID_PSFM"); - PmfmId2.names = Collections.unmodifiableList(names); - } - } -} diff --git a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java index 4271349..f1ae0a7 100644 --- a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java +++ b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java @@ -37,7 +37,6 @@ import fr.ifremer.adagio.core.dao.referential.pmfm.Matrix; import fr.ifremer.adagio.core.dao.referential.pmfm.MatrixId; import fr.ifremer.adagio.core.dao.referential.pmfm.MatrixImpl; import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmId; -import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmId2; import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxonImpl; import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.TuttiEntities; @@ -280,7 +279,7 @@ public class AccidentalBatchPersistenceServiceImpl extends AbstractPersistenceSe if (source.getLengthStepCaracteristic() != null) { - Caracteristic caracteristic = caracteristicService.getCaracteristic(PmfmId2.ID_PSFM.getValue()); + Caracteristic caracteristic = caracteristicService.getCaracteristic(PmfmId.ID_PMFM.getValue()); caracteristics.put(caracteristic, source.getLengthStepCaracteristic().getId()); @@ -321,7 +320,7 @@ public class AccidentalBatchPersistenceServiceImpl extends AbstractPersistenceSe batch.setWeight(weight); } - String lengthClassId = (String) result.remove(caracteristicService.getCaracteristic(PmfmId2.ID_PSFM.getValue())); + String lengthClassId = (String) result.remove(caracteristicService.getCaracteristic(PmfmId.ID_PMFM.getValue())); if (lengthClassId != null) { Caracteristic lengthStepCaracteristic = caracteristicService.getCaracteristic(Integer.valueOf(lengthClassId)); batch.setLengthStepCaracteristic(lengthStepCaracteristic); diff --git a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CaracteristicPersistenceServiceImpl.java b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CaracteristicPersistenceServiceImpl.java index 824c271..d90e163 100644 --- a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CaracteristicPersistenceServiceImpl.java +++ b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CaracteristicPersistenceServiceImpl.java @@ -29,7 +29,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmId; -import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmId2; import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueId; import fr.ifremer.adagio.core.dao.referential.pmfm.UnitId; import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch; @@ -84,7 +83,7 @@ public class CaracteristicPersistenceServiceImpl extends ReferentialPersistenceS PmfmId.TRAWL_DISTANCE.getValue(), PmfmId.SURVEY_PART.getValue(), PmfmId.SORTED_UNSORTED.getValue(), - PmfmId2.ID_PSFM.getValue() + PmfmId.ID_PMFM.getValue() ); } @@ -231,7 +230,7 @@ public class CaracteristicPersistenceServiceImpl extends ReferentialPersistenceS @Override public Caracteristic getPmfmIdCaracteristic() { - Integer pmfmId = PmfmId2.ID_PSFM.getValue(); + Integer pmfmId = PmfmId.ID_PMFM.getValue(); Caracteristic result = thisService.getCaracteristic(pmfmId); return result; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.