r2178 - in trunk: wao-persistence/src/main/java/fr/ifremer/wao/entity wao-persistence/src/main/resources/db/migration wao-persistence/src/main/xmi wao-services/src/main/java/fr/ifremer/wao/services/service
Author: bleny Date: 2014-07-29 14:20:29 +0200 (Tue, 29 Jul 2014) New Revision: 2178 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2178 Log: refs #4481 remove everything about indicators from database and model Removed: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorImpl.java trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorLevelImpl.java Modified: trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql trunk/wao-persistence/src/main/xmi/wao-model.zargo trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/WaoServiceSupport.java Deleted: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorImpl.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorImpl.java 2014-07-29 12:09:56 UTC (rev 2177) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorImpl.java 2014-07-29 12:20:29 UTC (rev 2178) @@ -1,52 +0,0 @@ -/* - * #%L - * Wao :: Business - * %% - * Copyright (C) 2009 - 2010 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.wao.entity; - -/** - * - */ -public class IndicatorImpl extends IndicatorAbstract { - - @Override - public SynthesisId getSynthesisId() { - SynthesisId result = null; - if (getIndicatorId() != null) { - result = SynthesisId.valueOf(getIndicatorId()); - } - return result; - } - - @Override - public void setSynthesisId(SynthesisId synthesisId) { - setIndicatorId(synthesisId.ordinal()); - } - - /** return the level that contains given value between it's two bound */ - @Override - public IndicatorLevel getLevelForValue(double value) { - for (IndicatorLevel level : getIndicatorLevel()) { - if (level.containsValue(value)) { - return level; - } - } - throw new IllegalStateException("no level found for value " + value); - } -} Deleted: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorLevelImpl.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorLevelImpl.java 2014-07-29 12:09:56 UTC (rev 2177) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/IndicatorLevelImpl.java 2014-07-29 12:20:29 UTC (rev 2178) @@ -1,90 +0,0 @@ -/* - * #%L - * Wao :: Business - * %% - * Copyright (C) 2009 - 2010 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.wao.entity; - -public class IndicatorLevelImpl extends IndicatorLevelAbstract { - - /** the upperBound of the lower level */ - protected double lowerBound; - - protected boolean upperBoundIncluded = false; - - @Override - public double getLowerBound() { - return lowerBound; - } - - @Override - public void setLowerBound(double lowerBound) { - this.lowerBound = lowerBound; - } - - @Override - public boolean isLowerBoundPositiveInfinity() { - return lowerBound == Double.MAX_VALUE; - } - - @Override - public void setLowerBoundToPositiveInfinity() { - lowerBound = Double.MAX_VALUE; - } - - @Override - public boolean lowerEqualsUpperBounds() { - return getLowerBound() == getUpperBound(); - } - - /** if upperBound and lowerBound are equals, return true if value is equals - * if lowerBound and upperBound are different, return true if value is - * between bound. - * - * upperBound is always strict comparison, lowerBound non-strict comparison - */ - @Override - public boolean containsValue(double value) { - boolean containsValue = false; - - if (upperBoundIncluded && value == upperBound) { - containsValue = true; - } else if (lowerEqualsUpperBounds()) { - containsValue = value == getUpperBound(); - } else { - if (getLowerBound() < getUpperBound()) { - containsValue = value >= getLowerBound() - && value < getUpperBound(); - } else { - containsValue = value >= getUpperBound() - && value < getLowerBound(); - } - } - - return containsValue; - } - - @Override - public boolean isUpperBoundIncluded() { - return upperBoundIncluded; - } - - public void setUpperBoundIncluded(boolean upperBoundIncluded) { - this.upperBoundIncluded = upperBoundIncluded; - } -} Modified: trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql =================================================================== --- trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql 2014-07-29 12:09:56 UTC (rev 2177) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql 2014-07-29 12:20:29 UTC (rev 2178) @@ -53,3 +53,9 @@ ALTER TABLE contact DROP COLUMN tidenbdays; ALTER TABLE contact DROP COLUMN obsprogramordinal; +-- Suppresion de tout ce qui concerne les indicateurs + +DROP TABLE indicatorlog; +DROP TABLE indicatorlevel; +DROP TABLE indicator; + Modified: trunk/wao-persistence/src/main/xmi/wao-model.zargo =================================================================== (Binary files differ) Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/WaoServiceSupport.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/WaoServiceSupport.java 2014-07-29 12:09:56 UTC (rev 2177) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/WaoServiceSupport.java 2014-07-29 12:20:29 UTC (rev 2178) @@ -32,9 +32,6 @@ import fr.ifremer.wao.entity.ElligibleBoatTopiaDao; import fr.ifremer.wao.entity.FishingGearDCFTopiaDao; import fr.ifremer.wao.entity.FishingZoneTopiaDao; -import fr.ifremer.wao.entity.IndicatorLevelTopiaDao; -import fr.ifremer.wao.entity.IndicatorLogTopiaDao; -import fr.ifremer.wao.entity.IndicatorTopiaDao; import fr.ifremer.wao.entity.NewsTopiaDao; import fr.ifremer.wao.entity.ProfessionTopiaDao; import fr.ifremer.wao.entity.ReferentialMetaTopiaDao; @@ -146,18 +143,6 @@ return getPersistenceContext().getFishingZoneDao(); } - protected IndicatorTopiaDao getIndicatorDao() { - return getPersistenceContext().getIndicatorDao(); - } - - protected IndicatorLevelTopiaDao getIndicatorLevelDao() { - return getPersistenceContext().getIndicatorLevelDao(); - } - - protected IndicatorLogTopiaDao getIndicatorLogDao() { - return getPersistenceContext().getIndicatorLogDao(); - } - protected NewsTopiaDao getNewsDao() { return getPersistenceContext().getNewsDao(); }
participants (1)
-
bleny@users.forge.codelutin.com