Author: tchemit Date: 2012-11-28 10:28:45 +0100 (Wed, 28 Nov 2012) New Revision: 24 Url: http://forge.codelutin.com/repositories/revision/tutti/24 Log: - introduce a new pakcage for referential entities - add trait catches like beans (name will be changed) - add different species decoration Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java Removed: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-28 09:28:45 UTC (rev 24) @@ -24,20 +24,25 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean; import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.CatchBean; -import fr.ifremer.tutti.persistence.entities.CountryBean; -import fr.ifremer.tutti.persistence.entities.GearBean; -import fr.ifremer.tutti.persistence.entities.SeaStateBean; -import fr.ifremer.tutti.persistence.entities.SexBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; import fr.ifremer.tutti.persistence.entities.StrataBean; import fr.ifremer.tutti.persistence.entities.SurveyBean; import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.persistence.entities.UserBean; -import fr.ifremer.tutti.persistence.entities.VesselBean; -import fr.ifremer.tutti.persistence.entities.ZoneBean; +import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import org.nuiton.util.ApplicationConfig; import java.io.Closeable; @@ -58,6 +63,8 @@ void close() throws IOException; + List<WeightCategoryBean> getAllWeightCategories(); + List<SexBean> getAllSex(); List<SpeciesBean> getAllSpecies(); @@ -84,6 +91,17 @@ List<TraitBean> getAllTraits(String campaignId); + List<TraitSpeciesCatchBean> getAllTraitSpeciesCatch(String traitId); + + List<TraitBenthosCatchBean> getAllTraitBenthosCatch(String traitId); + + List<TraitPlanctonCatchBean> getAllTraitPlanctonCatch(String traitId); + + List<TraitMacroDechetCatchBean> getAllTraitMacroDechetCatch(String traitId); + + List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId); + + SurveyBean getSurvey(String surveyId); CampaignBean getCampaign(String campaignId); @@ -102,5 +120,4 @@ TraitBean saveTrait(TraitBean bean); - List<CatchBean> getAllCatches(String traitId); } Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a beaufort scale. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class BeaufortScaleBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -24,6 +24,11 @@ * #L% */ +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; + import java.util.List; /** Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,46 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a catch. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class CatchBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected TraitBean trait; - - public TraitBean getTrait() { - return trait; - } - - public void setTrait(TraitBean trait) { - this.trait = trait; - } -} Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a country. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class CountryBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a gear. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class GearBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents the sea state. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class SeaStateBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,46 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a sex. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class SexBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,56 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a fishes species. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class SpeciesBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String codeMemo; - - protected String genusSpecies; - - public String getCodeMemo() { - return codeMemo; - } - - public void setCodeMemo(String codeMemo) { - this.codeMemo = codeMemo; - } - - public String getGenusSpecies() { - return genusSpecies; - } - - public void setGenusSpecies(String genusSpecies) { - this.genusSpecies = genusSpecies; - } -} Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -24,6 +24,8 @@ * #L% */ +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; + /** * To represent a survey. * Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -24,6 +24,10 @@ * #L% */ +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; + import java.util.Date; import java.util.List; Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,119 @@ +package fr.ifremer.tutti.persistence.entities; + +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; + +/** + * Represents a benthos catch while a trait. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class TraitBenthosCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware { + + private static final long serialVersionUID = 1L; + + /** + * When catch was observed. + * + * @since 0.2 + */ + protected TraitBean trait; + + /** + * Species observed. + * + * @since 0.2 + */ + protected SpeciesBean species; + + /** + * Is the species need to be confirmed?. + * + * @since 0.2 + */ + protected boolean speciesToConfirm; + + /** + * Is catch is vrac or horsVrac?. + * + * @since 0.2 + */ + protected VracHorsVracEnum vracHorsVrac; + + /** + * Observed weight. + * + * @since 0.2 + */ + protected Float weight; + + /** + * Sample weight. + * + * @since 0.2 + */ + protected Float sampleWeight; + + /** + * Elevation ratio. + * + * @since 0.2 + */ + protected Float elevationRatio; + + public TraitBean getTrait() { + return trait; + } + + public void setTrait(TraitBean trait) { + this.trait = trait; + } + + public SpeciesBean getSpecies() { + return species; + } + + public void setSpecies(SpeciesBean species) { + this.species = species; + } + + public boolean isSpeciesToConfirm() { + return speciesToConfirm; + } + + public void setSpeciesToConfirm(boolean speciesToConfirm) { + this.speciesToConfirm = speciesToConfirm; + } + + public VracHorsVracEnum getVracHorsVrac() { + return vracHorsVrac; + } + + public void setVracHorsVrac(VracHorsVracEnum vracHorsVrac) { + this.vracHorsVrac = vracHorsVrac; + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + this.weight = weight; + } + + public Float getSampleWeight() { + return sampleWeight; + } + + public void setSampleWeight(Float sampleWeight) { + this.sampleWeight = sampleWeight; + } + + public Float getElevationRatio() { + return elevationRatio; + } + + public void setElevationRatio(Float elevationRatio) { + this.elevationRatio = elevationRatio; + } +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,60 @@ +package fr.ifremer.tutti.persistence.entities; + +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; + +/** + * Represents a capture accidentel catch while a trait. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class TraitCaptureAccidentelCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{ + + private static final long serialVersionUID = 1L; + + /** + * When catch was observed. + * + * @since 0.2 + */ + protected TraitBean trait; + + /** + * Species observed. + * + * @since 0.2 + */ + protected SpeciesBean species; + + /** + * Observed weight. + * + * @since 0.2 + */ + protected Float weight; + + public TraitBean getTrait() { + return trait; + } + + public void setTrait(TraitBean trait) { + this.trait = trait; + } + + public SpeciesBean getSpecies() { + return species; + } + + public void setSpecies(SpeciesBean species) { + this.species = species; + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + this.weight = weight; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,14 @@ +package fr.ifremer.tutti.persistence.entities; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public interface TraitCatchBeanAware { + + TraitBean getTrait(); + + void setTrait(TraitBean trait); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,60 @@ +package fr.ifremer.tutti.persistence.entities; + +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; + +/** + * Represents a macro dechet catch while a trait. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class TraitMacroDechetCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{ + + private static final long serialVersionUID = 1L; + + /** + * When catch was observed. + * + * @since 0.2 + */ + protected TraitBean trait; + + /** + * Species observed. + * + * @since 0.2 + */ + protected SpeciesBean species; + + /** + * Observed weight. + * + * @since 0.2 + */ + protected Float weight; + + public TraitBean getTrait() { + return trait; + } + + public void setTrait(TraitBean trait) { + this.trait = trait; + } + + public SpeciesBean getSpecies() { + return species; + } + + public void setSpecies(SpeciesBean species) { + this.species = species; + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + this.weight = weight; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,60 @@ +package fr.ifremer.tutti.persistence.entities; + +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; + +/** + * Represents a plancton catch while a trait. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class TraitPlanctonCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{ + + private static final long serialVersionUID = 1L; + + /** + * When catch was observed. + * + * @since 0.2 + */ + protected TraitBean trait; + + /** + * Species observed. + * + * @since 0.2 + */ + protected SpeciesBean species; + + /** + * Observed weight. + * + * @since 0.2 + */ + protected Float weight; + + public TraitBean getTrait() { + return trait; + } + + public void setTrait(TraitBean trait) { + this.trait = trait; + } + + public SpeciesBean getSpecies() { + return species; + } + + public void setSpecies(SpeciesBean species) { + this.species = species; + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + this.weight = weight; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,213 @@ +package fr.ifremer.tutti.persistence.entities; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; + +/** + * Represents a catch of species while a trait. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class TraitSpeciesCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{ + + private static final long serialVersionUID = 1L; + + /** + * When catch was observed. + * + * @since 0.2 + */ + protected TraitBean trait; + + /** + * Species observed. + * + * @since 0.2 + */ + protected SpeciesBean species; + + /** + * Is the species need to be confirmed?. + * + * @since 0.2 + */ + protected boolean speciesToConfirm; + + /** + * Is catch is vrac or horsVrac?. + * + * @since 0.2 + */ + protected VracHorsVracEnum vracHorsVrac; + + /** + * Weight category (can be null). + * + * @since 0.2 + */ + protected WeightCategoryBean weightCategory; + + /** + * Sex (can be null). + * + * @since 0.2 + */ + protected SexBean sex; + + /** + * Maturity (can be null). + * + * @since 0.2 + */ + protected Float maturity; + + /** + * Age (can be null). + * + * @since 0.2 + */ + protected Float age; + + /** + * Observed weight. + * + * @since 0.2 + */ + protected Float weight; + + /** + * Sample weight. + * + * @since 0.2 + */ + protected Float sampleWeight; + + /** + * Elevation ratio. + * + * @since 0.2 + */ + protected Float elevationRatio; + + public TraitBean getTrait() { + return trait; + } + + public void setTrait(TraitBean trait) { + this.trait = trait; + } + + public SpeciesBean getSpecies() { + return species; + } + + public void setSpecies(SpeciesBean species) { + this.species = species; + } + + public Boolean getSpeciesToConfirm() { + return speciesToConfirm; + } + + public void setSpeciesToConfirm(Boolean speciesToConfirm) { + this.speciesToConfirm = speciesToConfirm; + } + + public boolean isSpeciesToConfirm() { + return speciesToConfirm; + } + + public void setSpeciesToConfirm(boolean speciesToConfirm) { + this.speciesToConfirm = speciesToConfirm; + } + + public VracHorsVracEnum getVracHorsVrac() { + return vracHorsVrac; + } + + public void setVracHorsVrac(VracHorsVracEnum vracHorsVrac) { + this.vracHorsVrac = vracHorsVrac; + } + + public WeightCategoryBean getWeightCategory() { + return weightCategory; + } + + public void setWeightCategory(WeightCategoryBean weightCategory) { + this.weightCategory = weightCategory; + } + + public SexBean getSex() { + return sex; + } + + public void setSex(SexBean sex) { + this.sex = sex; + } + + public Float getMaturity() { + return maturity; + } + + public void setMaturity(Float maturity) { + this.maturity = maturity; + } + + public Float getAge() { + return age; + } + + public void setAge(Float age) { + this.age = age; + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + this.weight = weight; + } + + public Float getSampleWeight() { + return sampleWeight; + } + + public void setSampleWeight(Float sampleWeight) { + this.sampleWeight = sampleWeight; + } + + public Float getElevationRatio() { + return elevationRatio; + } + + public void setElevationRatio(Float elevationRatio) { + this.elevationRatio = elevationRatio; + } +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a user. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class UserBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a vessel. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class VesselBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,10 @@ +package fr.ifremer.tutti.persistence.entities; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public enum VracHorsVracEnum { + VRAC, + HORS_VRAC +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -1,47 +0,0 @@ -package fr.ifremer.tutti.persistence.entities; - -/* - * #%L - * Tutti :: Persistence API - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 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% - */ - -/** - * Represents a survey zone. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class ZoneBean extends AbstractTuttiBean { - - private static final long serialVersionUID = 1L; - - protected String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} \ No newline at end of file Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a beaufort scale. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class BeaufortScaleBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a country. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class CountryBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a gear. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class GearBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents the sea state. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class SeaStateBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,48 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a sex. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class SexBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,58 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a fishes species. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class SpeciesBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String codeMemo; + + protected String genusSpecies; + + public String getCodeMemo() { + return codeMemo; + } + + public void setCodeMemo(String codeMemo) { + this.codeMemo = codeMemo; + } + + public String getGenusSpecies() { + return genusSpecies; + } + + public void setGenusSpecies(String genusSpecies) { + this.genusSpecies = genusSpecies; + } +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a user. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class UserBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a vessel. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class VesselBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,25 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a weight category. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class WeightCategoryBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java) =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java 2012-11-28 09:28:45 UTC (rev 24) @@ -0,0 +1,49 @@ +package fr.ifremer.tutti.persistence.entities.referential; + +/* + * #%L + * Tutti :: Persistence API + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ + +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; + +/** + * Represents a survey zone. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class ZoneBean extends AbstractTuttiBean { + + private static final long serialVersionUID = 1L; + + protected String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} \ No newline at end of file Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java =================================================================== --- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-28 09:28:45 UTC (rev 24) @@ -24,21 +24,19 @@ * #L% */ -import com.google.common.collect.Lists; -import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean; -import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.CatchBean; -import fr.ifremer.tutti.persistence.entities.CountryBean; -import fr.ifremer.tutti.persistence.entities.GearBean; -import fr.ifremer.tutti.persistence.entities.SeaStateBean; -import fr.ifremer.tutti.persistence.entities.SexBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; +import com.google.common.collect.ArrayListMultimap; +import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; import fr.ifremer.tutti.persistence.entities.StrataBean; -import fr.ifremer.tutti.persistence.entities.SurveyBean; -import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.persistence.entities.UserBean; -import fr.ifremer.tutti.persistence.entities.VesselBean; -import fr.ifremer.tutti.persistence.entities.ZoneBean; +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import java.util.List; import java.util.UUID; @@ -51,169 +49,145 @@ */ public class TuttiPersistenceDevFixtures { - protected final List<CampaignBean> campaign = Lists.newArrayList(); + protected final ArrayListMultimap<Class<? extends AbstractTuttiBean>, AbstractTuttiBean> cache; - protected final List<SurveyBean> survey = Lists.newArrayList(); - - protected final List<ZoneBean> zone = Lists.newArrayList(); - - protected final List<TraitBean> trait = Lists.newArrayList(); - - protected final List<CountryBean> country = Lists.newArrayList(); - - protected final List<VesselBean> vessel = Lists.newArrayList(); - - protected final List<GearBean> gear = Lists.newArrayList(); - - protected final List<UserBean> user = Lists.newArrayList(); - - protected final List<StrataBean> strata = Lists.newArrayList(); - - protected final List<SeaStateBean> seaState = Lists.newArrayList(); - - protected final List<BeaufortScaleBean> beaufortScale = Lists.newArrayList(); - - protected final List<SpeciesBean> species = Lists.newArrayList(); - - protected final List<CatchBean> catches = Lists.newArrayList(); - - protected final List<SexBean> sex = Lists.newArrayList(); - public TuttiPersistenceDevFixtures() { - // inject default datas + // inject default datas (only referential) + cache = ArrayListMultimap.create(); + ZoneBean b; b = new ZoneBean(); b.setId(UUID.randomUUID().toString()); b.setName("zone1"); - zone.add(b); + cache.put(ZoneBean.class, b); b = new ZoneBean(); b.setId(UUID.randomUUID().toString()); b.setName("zone2"); - zone.add(b); + cache.put(ZoneBean.class, b); CountryBean c; c = new CountryBean(); c.setId(UUID.randomUUID().toString()); c.setName("France"); - country.add(c); + cache.put(CountryBean.class, c); c = new CountryBean(); c.setId(UUID.randomUUID().toString()); c.setName("Espagne"); - country.add(c); + cache.put(CountryBean.class, c); VesselBean v; v = new VesselBean(); v.setId(UUID.randomUUID().toString()); v.setName("THALASSA"); - vessel.add(v); + cache.put(VesselBean.class, v); v = new VesselBean(); v.setId(UUID.randomUUID().toString()); v.setName("THALASSA-II"); - vessel.add(v); + cache.put(VesselBean.class, v); GearBean g; g = new GearBean(); g.setId(UUID.randomUUID().toString()); g.setName("Gear-1"); - gear.add(g); + cache.put(GearBean.class, g); g = new GearBean(); g.setId(UUID.randomUUID().toString()); g.setName("Gear-2"); - gear.add(g); + cache.put(GearBean.class, g); UserBean u; u = new UserBean(); u.setId(UUID.randomUUID().toString()); u.setName("Vincent Badts"); - user.add(u); + cache.put(UserBean.class, u); u = new UserBean(); u.setId(UUID.randomUUID().toString()); u.setName("Jean claude Mahet"); - user.add(u); + cache.put(UserBean.class, u); u = new UserBean(); u.setId(UUID.randomUUID().toString()); u.setName("Luisa Metral"); - user.add(u); + cache.put(UserBean.class, u); u = new UserBean(); u.setId(UUID.randomUUID().toString()); u.setName("Jean Hervé Bourdeix"); - user.add(u); + cache.put(UserBean.class, u); u = new UserBean(); u.setId(UUID.randomUUID().toString()); u.setName("Ysabelle Cheret"); - user.add(u); + cache.put(UserBean.class, u); u = new UserBean(); u.setId(UUID.randomUUID().toString()); u.setName("Blandine Brisset"); - user.add(u); + cache.put(UserBean.class, u); BeaufortScaleBean bs; bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Calme"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Très légère brise"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Petite brise"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Jolie brise"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Vent frais"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Grand frais"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Coup de vent"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); bs = new BeaufortScaleBean(); bs.setId(UUID.randomUUID().toString()); bs.setName("Fort coup de vent"); - beaufortScale.add(bs); + cache.put(BeaufortScaleBean.class, bs); SeaStateBean st; st = new SeaStateBean(); st.setId(UUID.randomUUID().toString()); st.setName("Mer calme"); - seaState.add(st); + cache.put(SeaStateBean.class, st); st = new SeaStateBean(); st.setId(UUID.randomUUID().toString()); st.setName("Mer agitée"); - seaState.add(st); + cache.put(SeaStateBean.class, st); SpeciesBean sp; @@ -221,101 +195,108 @@ sp.setId(UUID.randomUUID().toString()); sp.setCodeMemo("BAR"); sp.setGenusSpecies("Bar"); - species.add(sp); + cache.put(SpeciesBean.class, sp); sp = new SpeciesBean(); sp.setId(UUID.randomUUID().toString()); sp.setCodeMemo("CHIN"); sp.setGenusSpecies("Chinchard"); - species.add(sp); + cache.put(SpeciesBean.class, sp); sp = new SpeciesBean(); sp.setId(UUID.randomUUID().toString()); sp.setCodeMemo("FLE"); sp.setGenusSpecies("Flet"); - species.add(sp); + cache.put(SpeciesBean.class, sp); sp = new SpeciesBean(); sp.setId(UUID.randomUUID().toString()); sp.setCodeMemo("LIM"); sp.setGenusSpecies("Limande"); - species.add(sp); + cache.put(SpeciesBean.class, sp); SexBean se; se = new SexBean(); se.setId(UUID.randomUUID().toString()); se.setName("Male"); - sex.add(se); + cache.put(SexBean.class, se); se = new SexBean(); se.setId(UUID.randomUUID().toString()); se.setName("Male"); - sex.add(se); + cache.put(SexBean.class, se); se = new SexBean(); se.setId(UUID.randomUUID().toString()); se.setName("Femelle"); - sex.add(se); + cache.put(SexBean.class, se); se = new SexBean(); se.setId(UUID.randomUUID().toString()); se.setName("Indéterminé"); - sex.add(se); - } + cache.put(SexBean.class, se); - public List<CampaignBean> campaign() { - return campaign; - } + WeightCategoryBean wc; - public List<SurveyBean> survey() { - return survey; + wc = new WeightCategoryBean(); + wc.setId(UUID.randomUUID().toString()); + wc.setName("Petit"); + cache.put(WeightCategoryBean.class, wc); + + wc = new WeightCategoryBean(); + wc.setId(UUID.randomUUID().toString()); + wc.setName("Gros"); + cache.put(WeightCategoryBean.class, wc); + } public List<ZoneBean> zone() { - return zone; + return getData(ZoneBean.class); } - public List<TraitBean> trait() { - return trait; - } - public List<CountryBean> country() { - return country; + return getData(CountryBean.class); } + public List<VesselBean> vessel() { - return vessel; + return getData(VesselBean.class); } public List<GearBean> gear() { - return gear; + return getData(GearBean.class); } public List<UserBean> user() { - return user; + return getData(UserBean.class); } public List<StrataBean> strata() { - return strata; + return getData(StrataBean.class); } public List<SeaStateBean> seaState() { - return seaState; + return getData(SeaStateBean.class); } public List<BeaufortScaleBean> beaufortScale() { - return beaufortScale; + return getData(BeaufortScaleBean.class); } public List<SpeciesBean> species() { - return species; + return getData(SpeciesBean.class); } - public List<CatchBean> catches() { - return catches; + public List<SexBean> sex() { + return getData(SexBean.class); } - public List<SexBean> sex() { - return sex; + public List<WeightCategoryBean> weightCategory() { + return getData(WeightCategoryBean.class); } + + protected <B extends AbstractTuttiBean> List<B> getData(Class<B> entityType) { + List<B> result = (List<B>) cache.get(entityType); + return result; + } } Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java =================================================================== --- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-28 09:28:45 UTC (rev 24) @@ -26,25 +26,32 @@ import com.google.common.base.Predicate; +import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import fr.ifremer.tutti.persistence.config.TuttiPersistenceDevConfig; import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; -import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean; import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.CatchBean; -import fr.ifremer.tutti.persistence.entities.CountryBean; -import fr.ifremer.tutti.persistence.entities.GearBean; -import fr.ifremer.tutti.persistence.entities.SeaStateBean; -import fr.ifremer.tutti.persistence.entities.SexBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; import fr.ifremer.tutti.persistence.entities.StrataBean; import fr.ifremer.tutti.persistence.entities.SurveyBean; import fr.ifremer.tutti.persistence.entities.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitCatchBeanAware; +import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; import fr.ifremer.tutti.persistence.entities.TuttiBeans; -import fr.ifremer.tutti.persistence.entities.UserBean; -import fr.ifremer.tutti.persistence.entities.VesselBean; -import fr.ifremer.tutti.persistence.entities.ZoneBean; +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; @@ -73,33 +80,29 @@ private static final Log log = LogFactory.getLog(TuttiPersistenceDevImpl.class); - protected final List<CampaignBean> campaign = Lists.newArrayList(); + protected final ArrayListMultimap<Class<? extends AbstractTuttiBean>, AbstractTuttiBean> cache = ArrayListMultimap.create(); - protected final List<SurveyBean> survey = Lists.newArrayList(); + public static final List<Class<? extends AbstractTuttiBean>> TYPES = Lists.newArrayList( + BeaufortScaleBean.class, + CampaignBean.class, + CountryBean.class, + GearBean.class, + SeaStateBean.class, + SexBean.class, + SpeciesBean.class, + SurveyBean.class, + TraitBean.class, + TraitBenthosCatchBean.class, + TraitSpeciesCatchBean.class, + TraitPlanctonCatchBean.class, + TraitMacroDechetCatchBean.class, + TraitCaptureAccidentelCatchBean.class, + UserBean.class, + VesselBean.class, + WeightCategoryBean.class, + ZoneBean.class + ); - protected final List<ZoneBean> zone = Lists.newArrayList(); - - protected final List<TraitBean> trait = Lists.newArrayList(); - - protected final List<CountryBean> country = Lists.newArrayList(); - - protected final List<VesselBean> vessel = Lists.newArrayList(); - - protected final List<GearBean> gear = Lists.newArrayList(); - - protected final List<UserBean> user = Lists.newArrayList(); - - protected final List<StrataBean> strata = Lists.newArrayList(); - - protected final List<SeaStateBean> seaState = Lists.newArrayList(); - - protected final List<BeaufortScaleBean> beaufortScale = Lists.newArrayList(); - - protected final List<SpeciesBean> species = Lists.newArrayList(); - - protected final List<CatchBean> catches = Lists.newArrayList(); - protected final List<SexBean> sex= Lists.newArrayList(); - @Override public String getImplementationName() { return "Persistence Dev implementation"; @@ -117,129 +120,100 @@ throw new RuntimeException("Could not create directory", e); } - user.clear(); - country.clear(); - vessel.clear(); - gear.clear(); - zone.clear(); - survey.clear(); - campaign.clear(); - trait.clear(); - strata.clear(); - seaState.clear(); - beaufortScale.clear(); - species.clear(); - catches.clear(); - sex.clear(); + cache.clear(); TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures(); - user.addAll(loadEntities(UserBean.class, fixtures.user())); - country.addAll(loadEntities(CountryBean.class, fixtures.country())); - vessel.addAll(loadEntities(VesselBean.class, fixtures.vessel())); - gear.addAll(loadEntities(GearBean.class, fixtures.gear())); - zone.addAll(loadEntities(ZoneBean.class, fixtures.zone())); - survey.addAll(loadEntities(SurveyBean.class, fixtures.survey())); - campaign.addAll(loadEntities(CampaignBean.class, fixtures.campaign())); - trait.addAll(loadEntities(TraitBean.class, fixtures.trait())); - strata.addAll(loadEntities(StrataBean.class, fixtures.strata())); - seaState.addAll(loadEntities(SeaStateBean.class, fixtures.seaState())); - beaufortScale.addAll(loadEntities(BeaufortScaleBean.class, fixtures.beaufortScale())); - species.addAll(loadEntities(SpeciesBean.class, fixtures.species())); - catches.addAll(loadEntities(CatchBean.class, fixtures.catches())); - sex.addAll(loadEntities(SexBean.class, fixtures.sex())); + for (Class<? extends AbstractTuttiBean> entityType : TYPES) { + loadEntities(entityType, fixtures); + } } @Override public void close() throws IOException { - persistToFile(UserBean.class, user); - persistToFile(CountryBean.class, country); - persistToFile(VesselBean.class, vessel); - persistToFile(GearBean.class, gear); - persistToFile(ZoneBean.class, zone); - persistToFile(SurveyBean.class, survey); - persistToFile(CampaignBean.class, campaign); - persistToFile(TraitBean.class, trait); - persistToFile(StrataBean.class, strata); - persistToFile(SeaStateBean.class, seaState); - persistToFile(BeaufortScaleBean.class, beaufortScale); - persistToFile(SpeciesBean.class, species); - persistToFile(CatchBean.class, catches); - persistToFile(SexBean.class, sex); + for (Class<? extends AbstractTuttiBean> entityType : cache.keySet()) { + persistToFile(entityType); + } } @Override + public List<WeightCategoryBean> getAllWeightCategories() { + List<WeightCategoryBean> result = getDataInNewList(WeightCategoryBean.class); + return result; + } + + @Override public List<SexBean> getAllSex() { - List<SexBean> result = Lists.newArrayList(sex); + List<SexBean> result = getDataInNewList(SexBean.class); return result; } @Override public List<SpeciesBean> getAllSpecies() { - List<SpeciesBean> result = Lists.newArrayList(species); + List<SpeciesBean> result = getDataInNewList(SpeciesBean.class); return result; } @Override public List<SurveyBean> getAllSurveys() { - List<SurveyBean> result = Lists.newArrayList(survey); + List<SurveyBean> result = getDataInNewList(SurveyBean.class); return result; } @Override public List<ZoneBean> getAllZones() { - List<ZoneBean> result = Lists.newArrayList(zone); + List<ZoneBean> result = getDataInNewList(ZoneBean.class); return result; } @Override public List<CountryBean> getAllCountries() { - List<CountryBean> result = Lists.newArrayList(country); + List<CountryBean> result = getDataInNewList(CountryBean.class); return result; } @Override public List<VesselBean> getAllVessels() { - List<VesselBean> result = Lists.newArrayList(vessel); + List<VesselBean> result = getDataInNewList(VesselBean.class); return result; } @Override public List<GearBean> getAllGears() { - List<GearBean> result = Lists.newArrayList(gear); + List<GearBean> result = getDataInNewList(GearBean.class); return result; } @Override public List<UserBean> getAllUsers() { - List<UserBean> result = Lists.newArrayList(user); + List<UserBean> result = getDataInNewList(UserBean.class); return result; } @Override public List<SeaStateBean> getAllSeaStates() { - List<SeaStateBean> result = Lists.newArrayList(seaState); + List<SeaStateBean> result = getDataInNewList(SeaStateBean.class); return result; } @Override public List<StrataBean> getAllStratas() { - List<StrataBean> result = Lists.newArrayList(strata); + List<StrataBean> result = getDataInNewList(StrataBean.class); return result; } @Override public List<BeaufortScaleBean> getAllBeaufortScales() { - List<BeaufortScaleBean> result = Lists.newArrayList(beaufortScale); + List<BeaufortScaleBean> result = getDataInNewList(BeaufortScaleBean.class); return result; } @Override public List<CampaignBean> getAllCampaigns(final String surveyId) { - List<CampaignBean> result = Lists.newArrayList(Iterables.filter(campaign, new Predicate<CampaignBean>() { + List<CampaignBean> result = Lists.newArrayList(Iterables.filter(getData(CampaignBean.class), new Predicate<CampaignBean>() { @Override public boolean apply(CampaignBean input) { return surveyId.equals(input.getSurvey().getId()); @@ -250,7 +224,7 @@ @Override public List<TraitBean> getAllTraits(final String campaignId) { - List<TraitBean> result = Lists.newArrayList(Iterables.filter(trait, new Predicate<TraitBean>() { + List<TraitBean> result = Lists.newArrayList(Iterables.filter(getData(TraitBean.class), new Predicate<TraitBean>() { @Override public boolean apply(TraitBean input) { return campaignId.equals(input.getCampaign().getId()); @@ -260,93 +234,107 @@ } @Override - public List<CatchBean> getAllCatches(final String traitId) { - List<CatchBean> result = Lists.newArrayList(Iterables.filter(catches, new Predicate<CatchBean>() { - @Override - public boolean apply(CatchBean input) { - return traitId.equals(input.getTrait().getId()); - } - })); - return result; + public List<TraitSpeciesCatchBean> getAllTraitSpeciesCatch(final String traitId) { + return getAllTraitFilterCatches(TraitSpeciesCatchBean.class, traitId); } @Override + public List<TraitBenthosCatchBean> getAllTraitBenthosCatch(String traitId) { + return getAllTraitFilterCatches(TraitBenthosCatchBean.class, traitId); + } + + @Override + public List<TraitPlanctonCatchBean> getAllTraitPlanctonCatch(String traitId) { + return getAllTraitFilterCatches(TraitPlanctonCatchBean.class, traitId); + } + + @Override + public List<TraitMacroDechetCatchBean> getAllTraitMacroDechetCatch(String traitId) { + return getAllTraitFilterCatches(TraitMacroDechetCatchBean.class, traitId); + } + + @Override + public List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId) { + return getAllTraitFilterCatches(TraitCaptureAccidentelCatchBean.class, traitId); + } + + @Override public SurveyBean getSurvey(String surveyId) { - SurveyBean result = TuttiBeans.findById(survey, surveyId); + SurveyBean result = TuttiBeans.findById(getData(SurveyBean.class), surveyId); return result; } @Override public CampaignBean getCampaign(String campaignId) { - CampaignBean result = TuttiBeans.findById(campaign, campaignId); + CampaignBean result = TuttiBeans.findById(getData(CampaignBean.class), campaignId); return result; } @Override public TraitBean getTrait(String traitId) { - TraitBean result = TuttiBeans.findById(trait, traitId); + TraitBean result = TuttiBeans.findById(getData(TraitBean.class), traitId); return result; } @Override public SurveyBean createSurvey(SurveyBean bean) { SurveyBean result = new SurveyBean(); - persist(SurveyBean.class, bean, result, survey); + persist(SurveyBean.class, bean, result); return result; } @Override public SurveyBean saveSurvey(SurveyBean bean) { SurveyBean result = getSurvey(bean.getId()); - persist(SurveyBean.class, bean, result, survey); + persist(SurveyBean.class, bean, result); return result; } @Override public CampaignBean createCampaign(CampaignBean bean) { CampaignBean result = new CampaignBean(); - persist(CampaignBean.class, bean, result, campaign); + persist(CampaignBean.class, bean, result); return result; } @Override public CampaignBean saveCampaign(CampaignBean bean) { CampaignBean result = getCampaign(bean.getId()); - persist(CampaignBean.class, bean, result, campaign); + persist(CampaignBean.class, bean, result); return result; } @Override public TraitBean createTrait(TraitBean bean) { TraitBean result = new TraitBean(); - persist(TraitBean.class, bean, result, trait); + persist(TraitBean.class, bean, result); return result; } @Override public TraitBean saveTrait(TraitBean bean) { TraitBean result = getTrait(bean.getId()); - persist(TraitBean.class, bean, result, trait); + persist(TraitBean.class, bean, result); return result; } protected <B extends AbstractTuttiBean> void persist(Class<B> beanType, - B source, - B target, - List<B> entities) { + B source, B target) { + BinderFactory.newBinder(beanType).copyExcluding( source, target, "id"); if (source.getId() == null) { target.setId(UUID.randomUUID().toString()); } - if (!entities.contains(target)) { - entities.add(target); + if (!cache.containsValue(target)) { + cache.put(beanType, target); } - persistToFile(beanType, entities); + persistToFile(beanType); } - protected <B> List<B> loadEntities(Class<B> entityType, - List<B> defaultList) throws IOException { + protected <B extends AbstractTuttiBean> List<B> loadEntities(Class<B> entityType, + TuttiPersistenceDevFixtures fix + ) throws IOException { File storageFile = getStorageFile(entityType); List<B> result; @@ -362,6 +350,43 @@ result = (List<B>) oos.readObject(); oos.close(); + } catch (ClassNotFoundException e) { + throw new RuntimeException("Could not find a class ", e); + } finally { + IOUtils.closeQuietly(oos); + } + + cache.putAll(entityType, result); + } else { + + result = fix.getData(entityType); + + cache.putAll(entityType, result); + + // persist it right now + persistToFile(entityType); + } + + return result; + } + + protected <B extends AbstractTuttiBean> List<B> loadEntities(Class<B> entityType, + List<B> defaultList) throws IOException { + File storageFile = getStorageFile(entityType); + + List<B> result; + + if (storageFile.exists()) { + if (log.isDebugEnabled()) { + log.debug("Load data from file: " + storageFile); + } + + ObjectInputStream oos = + new ObjectInputStream(new FileInputStream(storageFile)); + try { + + result = (List<B>) oos.readObject(); + oos.close(); return result; } catch (ClassNotFoundException e) { throw new RuntimeException("Could not find a class ", e); @@ -373,8 +398,10 @@ result = defaultList; // persist it right now - persistToFile(entityType, result); + persistToFile(entityType); } + + cache.putAll(entityType, result); return result; } @@ -385,8 +412,9 @@ return result; } - protected <B> void persistToFile(Class<B> entityType, List<B> entities) { + protected <B extends AbstractTuttiBean> void persistToFile(Class<B> entityType) { + List<B> entities = getDataInNewList(entityType); File storageFile = getStorageFile(entityType); if (log.isDebugEnabled()) { @@ -408,4 +436,24 @@ } } + protected <B extends AbstractTuttiBean> List<B> getData(Class<B> entityType) { + List<B> result = (List<B>) cache.get(entityType); + return result; + } + + protected <B extends AbstractTuttiBean> List<B> getDataInNewList(Class<B> entityType) { + List<B> result = getData(entityType); + return Lists.newArrayList(result); + } + + protected <B extends AbstractTuttiBean & TraitCatchBeanAware> List<B> getAllTraitFilterCatches(Class<B> beanType,final String traitId) { + List<B> result = Lists.newArrayList(Iterables.filter(getData(beanType), new Predicate<B>() { + @Override + public boolean apply(B input) { + return traitId.equals(input.getTrait().getId()); + } + })); + return result; + } + } Modified: trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java =================================================================== --- trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2012-11-28 09:28:45 UTC (rev 24) @@ -84,7 +84,7 @@ Assert.assertTrue(storageDirectory.exists()); TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures(); - Assert.assertEquals(fixtures.survey().size(), persistence.getAllSurveys().size()); + Assert.assertEquals(fixtures.seaState().size(), persistence.getAllSeaStates().size()); } @Test @@ -97,11 +97,11 @@ persistence.open(config.getConfig()); TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures(); - Assert.assertEquals(fixtures.survey().size(), persistence.getAllSurveys().size()); + Assert.assertEquals(fixtures.seaState().size(), persistence.getAllSeaStates().size()); persistence.close(); Assert.assertTrue(storageDirectory.exists()); - Assert.assertEquals(fixtures.survey().size(), persistence.getAllSurveys().size()); + Assert.assertEquals(fixtures.seaState().size(), persistence.getAllSeaStates().size()); } @Test @@ -114,6 +114,8 @@ persistence.open(config.getConfig()); Assert.assertTrue(storageDirectory.exists()); + int size = persistence.getAllSurveys().size(); + SurveyBean s = new SurveyBean(); s.setId("46de4ba5-3be6-4ab6-9f39-586b8e491fda"); s.setName("Serie 3"); @@ -126,8 +128,7 @@ persistence.open(config.getConfig()); - TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures(); - Assert.assertEquals(fixtures.survey().size() + 1, persistence.getAllSurveys().size()); + Assert.assertEquals(size + 1, persistence.getAllSurveys().size()); } public static File getTestSpecificDirectory(Class<?> testClassName, Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-28 09:28:45 UTC (rev 24) @@ -24,19 +24,19 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean; import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.CountryBean; -import fr.ifremer.tutti.persistence.entities.GearBean; -import fr.ifremer.tutti.persistence.entities.SeaStateBean; -import fr.ifremer.tutti.persistence.entities.SexBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; import fr.ifremer.tutti.persistence.entities.StrataBean; import fr.ifremer.tutti.persistence.entities.SurveyBean; import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.persistence.entities.UserBean; -import fr.ifremer.tutti.persistence.entities.VesselBean; -import fr.ifremer.tutti.persistence.entities.ZoneBean; +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import org.nuiton.util.decorator.Decorator; import org.nuiton.util.decorator.DecoratorProvider; @@ -79,7 +79,7 @@ registerMultiJXPathDecorator(SurveyBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(CampaignBean.class, "${name}$s", "#", " - "); - registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${date}$td/%2$tm/%2$tY", "#", " - "); + registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${traitNumber}$s#${date}$td/%2$tm/%2$tY", "#", " - "); registerMultiJXPathDecorator(ZoneBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(VesselBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(CountryBean.class, "${name}$s", "#", " - "); @@ -90,6 +90,8 @@ registerMultiJXPathDecorator(StrataBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(SexBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(SpeciesBean.class, "${codeMemo}#${genusSpecies}$s", "#", " - "); + registerMultiJXPathDecorator(SpeciesBean.class, "byCode", "${codeMemo}#${genusSpecies}$s", "#", " - "); + registerMultiJXPathDecorator(SpeciesBean.class, "byGenius", "${genusSpecies}$s#${codeMemo}$s", "#", " - "); } }; Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-28 09:28:45 UTC (rev 24) @@ -26,20 +26,25 @@ import com.google.common.base.Preconditions; import fr.ifremer.tutti.persistence.TuttiPersistence; -import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean; import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.CatchBean; -import fr.ifremer.tutti.persistence.entities.CountryBean; -import fr.ifremer.tutti.persistence.entities.GearBean; -import fr.ifremer.tutti.persistence.entities.SeaStateBean; -import fr.ifremer.tutti.persistence.entities.SexBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; import fr.ifremer.tutti.persistence.entities.StrataBean; import fr.ifremer.tutti.persistence.entities.SurveyBean; import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.persistence.entities.UserBean; -import fr.ifremer.tutti.persistence.entities.VesselBean; -import fr.ifremer.tutti.persistence.entities.ZoneBean; +import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.ApplicationConfig; @@ -113,6 +118,12 @@ } @Override + public List<WeightCategoryBean> getAllWeightCategories() { + checkDriverExists(); + return driver.getAllWeightCategories(); + } + + @Override public List<SexBean> getAllSex() { checkDriverExists(); return driver.getAllSex(); @@ -197,12 +208,36 @@ } @Override - public List<CatchBean> getAllCatches(String traitId) { + public List<TraitSpeciesCatchBean> getAllTraitSpeciesCatch(String traitId) { checkDriverExists(); - return driver.getAllCatches(traitId); + return driver.getAllTraitSpeciesCatch(traitId); } @Override + public List<TraitBenthosCatchBean> getAllTraitBenthosCatch(String traitId) { + checkDriverExists(); + return driver.getAllTraitBenthosCatch(traitId); + } + + @Override + public List<TraitPlanctonCatchBean> getAllTraitPlanctonCatch(String traitId) { + checkDriverExists(); + return driver.getAllTraitPlanctonCatch(traitId); + } + + @Override + public List<TraitMacroDechetCatchBean> getAllTraitMacroDechetCatch(String traitId) { + checkDriverExists(); + return driver.getAllTraitMacroDechetCatch(traitId); + } + + @Override + public List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId) { + checkDriverExists(); + return driver.getAllTraitCaptureAccidentelCatch(traitId); + } + + @Override public SurveyBean getSurvey(String surveyId) { checkDriverExists(); return driver.getSurvey(surveyId); Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties =================================================================== --- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-26 10:32:29 UTC (rev 23) +++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-28 09:28:45 UTC (rev 24) @@ -1,11 +1,8 @@ tutti.config.application.site.url=Url du site internet de l'application tutti.config.application.version=Version de l'application -tutti.config.campaignId=Identifiant de la dernière campagne utilisée tutti.config.data.directory=Répertoire de données de l'application. Vous pouvez utiliser l'expression ${tutti.data.directory} pour le référence dans d'autres propriétés de configuration (ex\: ${tutti.data.directory}/tmp). tutti.config.license.organizationName=Nom de l'organisation dans la licence -tutti.config.surveyId=Identifiant de la dernière série de campagne utilisée tutti.config.tmp.directory=Répertoire temporaire utilisée par l'application (est nettoyé à chaque démarrage de l'application) -tutti.config.ui.config=Chemin du fichier de configuration des interfaces graphiques tutti.property.beaufortScaleBean=Vent beaufort tutti.property.campaignBean=Campagne tutti.property.codeMemo=Code Memo