r161 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence tutti-persistence/src/main/xmi tutti-persistence-adagio tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/main/resources tutti-persistence-adagio/src/test tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/test/resources tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence tutti-persistence-dev/src/test/java/fr/
Author: tchemit Date: 2013-01-09 19:34:01 +0100 (Wed, 09 Jan 2013) New Revision: 161 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/161 Log: refs #1807: [Persistence] Adagio r?\195?\169f?\195?\169rentiel (ecriture des requetes + quelque modification sur le modele pour adapter) refs #1911: [CAMPAGNE] - Gestion des campagnes (filtrage des navires) (debut du code) Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java trunk/tutti-persistence-adagio/src/test/server.properties trunk/tutti-persistence-adagio/src/test/startServer.sh trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java Removed: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java Modified: trunk/tutti-persistence-adagio/README.txt trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 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/xmi/tutti-persistence.zargo trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_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 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-01-09 18:34:01 UTC (rev 161) @@ -72,8 +72,45 @@ //-- Referential methods --// //------------------------------------------------------------------------// + /** + * @return all available zones (used by a {@link Program}. + * @see Program#getZone() + * @see Program#setZone(Zone) + * @since 0.3 + */ + List<Zone> getAllProgramZone(); + + /** + * @return all countries (used by a {@link Cruise}). + * @see {@link Cruise#getCountry()} + * @see {@link Cruise#setCountry(Country)} + * @since 0.1 + */ + List<Country> getAllCountry(); + + /** + * @return all scientific vessels (used by a {@link Cruise}). + * @see Cruise#getVessel() + * @see Cruise#setVessel(List) + * @since 0.3 + */ + List<Vessel> getAllScientificVessel(); + + /** + * @return all commercial vessels (used by a {@link Cruise}). + * @see Cruise#getVessel() + * @see Cruise#setVessel(List) + * @since 0.3 + */ + List<Vessel> getAllFishingVessel(); + List<Species> getAllSpecies(); + List<Species> getAllBenthosSpecies(); + + List<Species> getAllPlanktonSpecies(); + + Species getSpecies(String speciesId); List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId); @@ -102,14 +139,10 @@ Caracteristic getMacroWasteSizeCategoryCaracteristic(); - List<Zone> getAllZone(); + List<Gear> getAllScientificGear(); - List<Country> getAllCountry(); + List<Gear> getAllFishingGear(); - List<Vessel> getAllVessel(); - - List<Gear> getAllGear(); - List<Person> getAllPerson(); //------------------------------------------------------------------------// Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo =================================================================== (Binary files differ) Modified: trunk/tutti-persistence-adagio/README.txt =================================================================== --- trunk/tutti-persistence-adagio/README.txt 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/README.txt 2013-01-09 18:34:01 UTC (rev 161) @@ -0,0 +1,20 @@ + +Pour se connecter à la base +--------------------------- + +java -jar ~/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar --inlineRC URL=jdbc:hsqldb:file:src/test/db/allegro,USER=sa + +(cd src/test ; ./connectDb.sh) + +Pour lancer la base en mode serveur +----------------------------------- + +(cd src/test ; ./startServer.sh) + +On peut ensuite accéder à la base via l'url jdbc:hsqldb://localhost/allegro + + +Se connecter à une superbe ui swing de requétage +------------------------------------------------ + +java -classpath ~/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar org.hsqldb.util.DatabaseManager \ No newline at end of file Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-09 18:34:01 UTC (rev 161) @@ -26,7 +26,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -import fr.ifremer.adagio.core.dao.referential.gear.GearImpl; import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; @@ -39,6 +38,7 @@ import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; import fr.ifremer.tutti.persistence.entities.referential.AbstractTuttiReferentialEntity; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; +import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; import fr.ifremer.tutti.persistence.entities.referential.Country; import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation; import fr.ifremer.tutti.persistence.entities.referential.Gear; @@ -51,9 +51,14 @@ import org.apache.commons.logging.LogFactory; import org.hibernate.Query; import org.hibernate.SessionFactory; +import org.hibernate.type.DateType; +import org.hibernate.type.IntegerType; +import org.hibernate.type.Type; import org.springframework.transaction.annotation.Transactional; import java.io.IOException; +import java.util.Date; +import java.util.Iterator; import java.util.List; import java.util.Properties; @@ -62,6 +67,7 @@ * @since 0.2 */ //@TransactionConfiguration(transactionManager = "transactionManager") +@Transactional(readOnly = true) public class TuttiPersistenceAdagioImpl implements TuttiPersistence { /** Logger. */ @@ -110,142 +116,341 @@ //-- Referential methods --// //------------------------------------------------------------------------// - @Transactional(readOnly = true) @Override - public List<Species> getAllSpecies() { - return null; + public List<Zone> getAllProgramZone() { + Iterator<Object[]> list = queryList( + "allProgramZones", + "locationLevelId", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.PROGRAM")); + + List<Zone> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Zone target = new Zone(); + target.setId((String) source[0]); + target.setName((String) source[1]); + target.setDescription((String) source[2]); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public Species getSpecies(String speciesId) { - return null; + public List<Country> getAllCountry() { + Iterator<Object[]> list = queryList( + "allCountries", + "locationLevelId", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.PAYS_ISO3")); + + List<Country> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Country target = new Country(); + target.setId(String.valueOf(source[0])); + target.setName((String) source[1]); + target.setDescription((String) source[2]); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) { - return null; + public List<Vessel> getAllScientificVessel() { + + Iterator<Object[]> list = queryList( + "allVessels", + "refDate", DateType.INSTANCE, new Date(), + "vesselTypeId", IntegerType.INSTANCE, getEnumerationIntegerCode("VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL")); + + List<Vessel> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Vessel target = new Vessel(); + target.setScientificVessel(true); + target.setId((String) source[0]); + target.setRegistrationCode((String) source[1]); + target.setInternalRegistrationCode((String) source[2]); + target.setName((String) source[3]); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) { - return null; + public List<Vessel> getAllFishingVessel() { + Iterator<Object[]> list = queryList( + "allVessels", + "refDate", DateType.INSTANCE, new Date(), + "vesselTypeId", IntegerType.INSTANCE, getEnumerationIntegerCode("VesselTypeId.FISHING_VESSEL")); + + List<Vessel> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Vessel target = new Vessel(); + target.setId((String) source[0]); + target.setRegistrationCode((String) source[1]); + target.setInternalRegistrationCode((String) source[2]); + target.setName((String) source[3]); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) { - return null; + public List<Gear> getAllScientificGear() { + + Iterator<Object[]> sources = queryList( + "allGears", + "gearClassificiationId", IntegerType.INSTANCE, getEnumerationIntegerCode("GearClassificationId.SCIENTIFIC_CRUISE")); + List<Gear> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Gear target = new Gear(); + target.setId(String.valueOf(source[0])); + target.setName(String.valueOf(source[1])); + target.setLabel(String.valueOf(source[2])); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<Zone> getAllZone() { - return null; + public List<Gear> getAllFishingGear() { + Iterator<Object[]> sources = queryList( + "allGears", + "gearClassificiationId", IntegerType.INSTANCE, getEnumerationIntegerCode("GearClassificationId.FAO")); + List<Gear> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Gear target = new Gear(); + target.setId(String.valueOf(source[0])); + target.setName(String.valueOf(source[1])); + target.setLabel(String.valueOf(source[2])); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<Country> getAllCountry() { - return null; + public List<Person> getAllPerson() { + Iterator<Object[]> list = queryList( + "allPersons"); + + List<Person> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Person target = new Person(); + target.setId(String.valueOf(source[0])); + target.setFirstName(String.valueOf(source[1])); + target.setLastName(String.valueOf(source[2])); + target.setDepartment(String.valueOf(source[3])); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<Vessel> getAllVessel() { - return null; + public List<Species> getAllSpecies() { + Iterator<Object[]> sources = queryList( + "allSpecies", + "taxonGroupCode", IntegerType.INSTANCE, getEnumerationIntegerCode("TaxonGroupTypeCode.METIER_SPECIES")); + + List<Species> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Species target = loadSpecies(source); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<Gear> getAllGear() { - Query query = sessionFactory.getCurrentSession().getNamedQuery("getAllGears"); + public Species getSpecies(String speciesId) { + Object[] source = queryUnique("species", + "taxonGroupCode", IntegerType.INSTANCE, Integer.valueOf(speciesId)); - List gears = query.list(); - List<Gear> result = Lists.newArrayList(); - for (Object o : gears) { - GearImpl gearImpl = (GearImpl) o; - Gear g = new Gear(); - g.setId(String.valueOf(gearImpl.getId())); - g.setName(gearImpl.getName()); - g.setDescription(gearImpl.getLabel()); - setStatus(gearImpl.getStatus(), g); - result.add(g); + Species target = loadSpecies(source); + return target; + } + + @Override + public List<Species> getAllBenthosSpecies() { + Iterator<Object[]> sources = queryList( + "allBenthosSpecies", + "taxonGroupCode", IntegerType.INSTANCE, getEnumerationIntegerCode("TaxonGroupTypeCode.METIER_SPECIES")); + + List<Species> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Species target = loadSpecies(source); + result.add(target); } return result; } - @Transactional(readOnly = true) @Override - public List<Person> getAllPerson() { - return null; + public List<Species> getAllPlanktonSpecies() { + Iterator<Object[]> sources = queryList( + "allPlanktonSpecies", + "taxonGroupCode", IntegerType.INSTANCE, getEnumerationIntegerCode("TaxonGroupTypeCode.METIER_SPECIES")); + + List<Species> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Species target = loadSpecies(source); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() { - return null; + public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() { + Iterator<Object[]> sources = queryList( + "allLengthStepCaracteristics", + "matrixId", IntegerType.INSTANCE, getEnumerationIntegerCode("MatrixId.BATCH")); + List<Caracteristic> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Caracteristic target = loadCaracteristic(source); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override public List<Caracteristic> getAllFishingOperationGearCaracteristic() { - return null; + Iterator<Object[]> sources = queryList( + "allPmfmsByMatrixId", + "matrixId", IntegerType.INSTANCE, getEnumerationIntegerCode("MatrixId.GEAR")); + List<Caracteristic> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Caracteristic target = loadCaracteristic(source); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override + public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() { + Iterator<Object[]> sources = queryList( + "allPmfmsByParameterGroudId", + "parameterGroupId", IntegerType.INSTANCE, getEnumerationIntegerCode("ParameterGroupId.ENVIRONEMENT_MEASUREMENT")); + List<Caracteristic> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Caracteristic target = loadCaracteristic(source); + result.add(target); + } + return result; + } + + @Override public List<Caracteristic> getAllFishingOperationHydrologicCaracteristic() { - return null; + Iterator<Object[]> sources = queryList( + "allPmfmsByParameterGroudId", + "parameterGroupId", IntegerType.INSTANCE, getEnumerationIntegerCode("ParameterGroupId.HYDROLOGIC_MEASUREMENT")); + List<Caracteristic> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + Caracteristic target = loadCaracteristic(source); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override - public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() { - return null; + public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) { + Iterator<Object[]> sources = queryList( + "allFishingOperationStratas", + "locationLevel", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.STRATA")); + List<FishingOperationLocation> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + FishingOperationLocation target = loadFishingOperationLocation(source); + result.add(target); + } + return result; } - @Transactional(readOnly = true) @Override + public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) { + Iterator<Object[]> sources = queryList( + "allFishingOperationSubStratas", + "locationLevel", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.SUBSTRATA")); + List<FishingOperationLocation> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + FishingOperationLocation target = loadFishingOperationLocation(source); + result.add(target); + } + return result; + } + + @Override + public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) { + Iterator<Object[]> sources = queryList( + "allFishingOperationLocalites", + "locationLevel", IntegerType.INSTANCE, getEnumerationIntegerCode("LocationLevelId.LOCALITE")); + List<FishingOperationLocation> result = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + FishingOperationLocation target = loadFishingOperationLocation(source); + result.add(target); + } + return result; + } + + @Override public Caracteristic getSizeCategoryCaracteristic() { - return null; + Integer pmfmId = getEnumerationIntegerCode("PmfmId.SIZE_CATEGORY"); + Caracteristic result = loadCaracteristic(pmfmId); + return result; } - @Transactional(readOnly = true) @Override public Caracteristic getSexCaracteristic() { - return null; + Integer pmfmId = getEnumerationIntegerCode("PmfmId.SEX"); + Caracteristic result = loadCaracteristic(pmfmId); + return result; } - @Transactional(readOnly = true) @Override public Caracteristic getSortedUnsortedCaracteristic() { - return null; + Integer pmfmId = getEnumerationIntegerCode("PmfmId.SORTED_UNSORTED"); + Caracteristic result = loadCaracteristic(pmfmId); + return result; } - @Transactional(readOnly = true) @Override public Caracteristic getMaturityCaracteristic() { - return null; + Integer pmfmId = getEnumerationIntegerCode("PmfmId.MATURITY"); + Caracteristic result = loadCaracteristic(pmfmId); + return result; } - @Transactional(readOnly = true) @Override public Caracteristic getMacroWasteCategoryCaracteristic() { - return null; + Integer pmfmId = getEnumerationIntegerCode("PmfmId.MACRO_WASTE_CATEGORY"); + Caracteristic result = loadCaracteristic(pmfmId); + return result; } - @Transactional(readOnly = true) @Override public Caracteristic getMacroWasteSizeCategoryCaracteristic() { - return null; + Integer pmfmId = getEnumerationIntegerCode("PmfmId.MACRO_WASTE_SIZE_CATEGORY"); + Caracteristic result = loadCaracteristic(pmfmId); + return result; } - //------------------------------------------------------------------------// //-- Program methods --// //------------------------------------------------------------------------// + //------------------------------------------------------------------------// @Override public List<Program> getAllProgram() { @@ -517,4 +722,145 @@ newStatus.setName(status.getName()); entity.setStatus(newStatus); } + + protected String getEnumerationStringCode(String key) { + String result = enumerations.getProperty(key); + Preconditions.checkNotNull( + result, + "Could not find enumeration code for key [" + key + ']'); + return result; + } + + protected Integer getEnumerationIntegerCode(String key) { + String value = getEnumerationStringCode(key); + return Integer.valueOf(value); + } + + protected Iterator<Object[]> queryList(String queryName, Object... params) { + + Query query = sessionFactory.getCurrentSession().getNamedQuery(queryName); + + if (params.length > 0) { + + Preconditions.checkArgument( + params.length % 3 == 0, + "Params must be tuple (paramName, paramType, paramValue)"); + + int nbParams = params.length / 3; + + for (int i = 0; i < nbParams; i++) { + String paramName = (String) params[3 * i]; + Type paramType = (Type) params[3 * i + 1]; + Object paramValue = params[3 * i + 2]; + query.setParameter(paramName, paramValue, paramType); + if (log.isDebugEnabled()) { + log.debug("query [" + queryName + "] (param " + i + + " [" + paramName + '=' + paramValue + "])"); + } + } + } + Iterator result = query.iterate(); + return result; + } + + protected Object[] queryUnique(String queryName, Object... params) { + + Query query = sessionFactory.getCurrentSession().getNamedQuery(queryName); + + if (params.length > 0) { + + Preconditions.checkArgument( + params.length % 3 == 0, + "Params must be tuple (paramName, paramType, paramValue)"); + + int nbParams = params.length / 3; + + for (int i = 0; i < nbParams; i++) { + String paramName = (String) params[3 * i]; + Type paramType = (Type) params[3 * i + 1]; + Object paramValue = params[3 * i + 2]; + query.setParameter(paramName, paramValue, paramType); + if (log.isDebugEnabled()) { + log.debug("query [" + queryName + "] (param " + i + + " [" + paramName + '=' + paramValue + "])"); + } + } + } + Object result = query.uniqueResult(); + return (Object[]) result; + } + + protected void loadCaracteristicQualitativeValues(Caracteristic caracteristic, + Integer pmfmId) { + Preconditions.checkNotNull(caracteristic, "Caracteristic can not be null"); + Preconditions.checkNotNull(pmfmId, "pmfmId can not be null"); + Preconditions.checkArgument(caracteristic.isQualitativeType(), "Caracteristic must be a qualitativeValue type"); + + Iterator<Object[]> sources = queryList( + "pmfmQualitativeValues", + "pmfmId", IntegerType.INSTANCE, pmfmId); + + List<CaracteristicQualitativeValue> values = Lists.newArrayList(); + while (sources.hasNext()) { + Object[] source = sources.next(); + CaracteristicQualitativeValue target = new CaracteristicQualitativeValue(); + target.setId(String.valueOf(source[0])); + target.setName(String.valueOf(source[1])); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[2], target); + values.add(target); + } + caracteristic.setQualitativeValue(values); + } + + protected Caracteristic loadCaracteristic(Integer pmfmId) { + + Object[] source = queryUnique("pmfmById", + "pmfmId", IntegerType.INSTANCE, pmfmId); + + Caracteristic target = loadCaracteristic(source); + + if (target.isQualitativeType()) { + + // load qualititative values + loadCaracteristicQualitativeValues(target, pmfmId); + } + return target; + } + + protected Caracteristic loadCaracteristic(Object[] source) { + + Caracteristic target = new Caracteristic(); + target.setId(String.valueOf(source[0])); + target.setParameterName(String.valueOf(source[1])); + target.setMatrixName(String.valueOf(source[2])); + target.setFractionName(String.valueOf(source[3])); + target.setMethodName(String.valueOf(source[4])); + target.setNumberType(Boolean.valueOf(source[5].toString())); + target.setQualitativeType(Boolean.valueOf(source[6].toString())); + + target.setUnit(String.valueOf(source[7])); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[8], target); + return target; + } + + protected FishingOperationLocation loadFishingOperationLocation(Object[] source) { + FishingOperationLocation target = new FishingOperationLocation(); + target.setId(String.valueOf(source[0])); + target.setName(String.valueOf(source[1])); + target.setLabel(String.valueOf(source[2])); + target.setDescription(String.valueOf(source[3])); + target.setLocationLevel(Integer.valueOf(source[4].toString())); + + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[5], target); + return target; + } + + protected Species loadSpecies(Object[] source) { + Species target = new Species(); + target.setId(String.valueOf(source[0])); + target.setCodeMemo(String.valueOf(source[1])); + target.setName(String.valueOf(source[2])); + setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target); + return target; + } } Modified: trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml =================================================================== --- trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml 2013-01-09 18:34:01 UTC (rev 161) @@ -24,7 +24,7 @@ --> <beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" @@ -36,17 +36,17 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!--<context:component-scan base-package="fr.ifremer.adagio.core.service" />--> - <!-- Activates various annotations to be detected in bean classes: Spring's - @Required and @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy - and @Resource (if available) and JPA's @PersistenceContext and @PersistenceUnit + <!-- Activates various annotations to be detected in bean classes: Spring's + @Required and @Autowired, as well as JSR 250's @PostConstruct, @PreDestroy + and @Resource (if available) and JPA's @PersistenceContext and @PersistenceUnit (if available). --> <!--<context:annotation-config />--> - <!--Platform Transaction Manager declared as "transactionManager" will be + <!--Platform Transaction Manager declared as "transactionManager" will be used. --> - <!--"aspectj" mode enables load-time/compile-time weaving of transactional - methods, which enables those methods to be intercepted even when called internally. - (Unlike Spring generated proxies which will only be intercepted when called + <!--"aspectj" mode enables load-time/compile-time weaving of transactional + methods, which enables those methods to be intercepted even when called internally. + (Unlike Spring generated proxies which will only be intercepted when called from outside) --> <tx:annotation-driven transaction-manager="transactionManager" /> @@ -55,8 +55,410 @@ <property name="sessionFactory" ref="sessionFactory" /> </bean> - <!--Enables the use of @AspectJ style of aspects' declarations. AspectJ + <!--Enables the use of @AspectJ style of aspects' declarations. AspectJ run-time isn't necessarily involved --> <!--<aop:aspectj-autoproxy />--> + <!--bean id="dataSource2" + class="org.apache.commons.dbcp.BasicDataSource" + destroy-method="close"> + <property name="driverClassName" value="${dataSource.jdbc.driver}"/> + <property name="url" value="${dataSource.jdbc.url}"/> + <property name="username" value="${dataSource.jdbc.username}"/> + <property name="password" value="${dataSource.jdbc.password}"/> + </bean> + + <bean id="sessionFactory2" + class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> + <property name="dataSource" ref="dataSource2" /> + <property name="hibernateProperties"> + <props> + <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> + <prop key="hibernate.show_sql">true</prop> + <prop key="hibernate.default_batch_fetch_size">40</prop> + <prop key="hibernate.max_fetch_depth">4</prop> + <prop key="hibernate.query.substitutions">true 1, false 0</prop> + <prop key="hibernate.cache.use_second_level_cache">true</prop> + <prop key="hibernate.cache.use_query_cache">true</prop> + + <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop> + <prop key="hibernate.cache.query_cache_factory">org.hibernate.cache.StandardQueryCacheFactory</prop> + <prop key="net.sf.ehcache.configurationResourceName">ehcache.xml</prop> + <prop key="hibernate.format_sql">true</prop> + <prop key="hibernate.use_sql_comments">true</prop> + <prop key="hibernate.bytecode.provider">cglib</prop> + <prop key="hibernate.jdbc.use_streams_for_binary">true</prop> + + <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop> + + </props> + </property--> + <!--property name="mappingResources"> + <list> + <value>queries-override2.hbm.xml</value> + <value>file:///home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value> + </list> + </property--> + <!--property name="mappingLocations"> + <list> + <value>classpath:queries.hbm.xml</value> + <value>classpath:queries-override.hbm.xml</value> + <value>file:///home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/PersonSessionVessel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/UserProfil.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/PersonSession.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/VesselManagePeriod.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ManagedDataTransfer.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ManagedDataType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/DepartmentPrivilegeTransfert.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/Person.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ManagedData.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/ageReader/AgeReaderQualification.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/user/Department.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Strategy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmAppliedStrategy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/ReferenceTaxonStrategy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedStrategy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedPeriod.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Person.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Program.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/AcquisitionLevel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/BatchModelAppliedStrategy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Department.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/ProgramPrivilege.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmStrategy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingVesselHierarchy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingItemHierarchy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchyException.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchy.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/DepthGradient.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/NearbySpecificArea.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea2RegulationLocation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/Corpus.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/CorpusType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/RightToProduce.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/MinimumSizeAllowed.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/regulation/Fishery.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/seller/SellerType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/seller/Seller.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/PrecisionType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSystem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItemType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSide.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/ProcessingStatus.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/DistanceToCoastGradient.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemLine.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemArea.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem2Location.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemPoint.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/SurveyQualification.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/VesselType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/ObjectType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/Status.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/ProcessingType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/LinkedItemType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/GearClassification.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/GearClassificationAssociation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/GearAssociation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/gear/Gear.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/location/Location.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/location/LocationClassification.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/location/LocationLevel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/location/LocationAssociation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/samplingScheme/denormalized/DenormalizedSamplingStrata.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/buyer/Buyer.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/buyer/BuyerType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/GroupingClassification.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/GroupingItem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/Grouping.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/grouping/GroupingLevel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/PhotoType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/SaleType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroup.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupHistoricalRecord.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/ReferenceDocument.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/Citation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupInformation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonNameHistory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/ReferenceTaxon.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformationHistory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonName.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/TaxonomicLevel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/taxon/VirtualComponent.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselOwner.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/EducationGrade.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselFeatures.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselRegistrationPeriod.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselOwnerPeriod.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselEngineType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselMasterPeriod.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/Vessel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/vessel/VesselMaster.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/metier/Metier.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/order/OrderItem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/order/OrderType.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/conversion/UnitConversion.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/conversion/WeightLengthConversion.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/conversion/RoundWeightConversion.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/qualification/QualificationRule.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Matrix.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Unit.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/ParameterGroup.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Fraction.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Method.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Pmfm.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/Parameter.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/AggregationLevel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/pmfm/QualitativeValue.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/NumericalPrecision.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/QualityFlag.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/referential/AnalysisInstrument.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/batch/BatchExhaustiveInventory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/batch/BatchModel.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/batch/Batch.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalizedBatch.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalisedBatchSortingValue.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/qualification/AppliedQualificationRule.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/qualification/QualifiedItem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/takeOver/TakeOver.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/physicalGear/PhysicalGearSurvey.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/declaration/DeclaredDocumentReference.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/economy/EconomicalSurvey.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/activity/ActivityCalendar.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/activity/DailyActivityCalendar.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/sale/SaleOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/sale/Sale.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTrip.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTripOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/scientificCruise/ScientificCruise.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/fishingEffort/FishingEffortCalendar.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/landing/LandingOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/survey/landing/Landing.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/sale/ExpectedSale.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea2RegulationLocation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/operation/denormalized/DenormalizedOperation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/operation/Operation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/operation/OperationVesselAssociation.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/sample/Sample.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/transshipment/Transshipment.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/LandingMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/VesselPhysicalMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/QuantificationMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/VesselUseMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/file/MeasurementFile.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/VesselPositionMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SaleMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/photo/Photo.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/TakeOverMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/GearUseMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SortingMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SampleMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/SurveyMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/measure/GearPhysicalMeasurement.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/link/LinkedItem.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/produce/Produce.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/history/UpdatedItemHistory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/history/InsertedItemHistory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/history/ProcessingHistory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/history/DeletedItemHistory.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/position/VesselPosition.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeatures.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeaturesOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeatures.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeaturesOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeaturesOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeaturesOrigin.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeatures.hbm.xml</value> + <value>classpath:fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeatures.hbm.xml</value> + </list> + </property--> + <!--property name="mappingLocations"> + <list> + <value>queries-override2.hbm.xml</value> + <value>file:///home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/PersonSessionVessel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/UserProfil.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/PersonSession.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/VesselManagePeriod.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ManagedDataTransfer.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ManagedDataType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/DepartmentPrivilegeTransfert.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/Person.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ManagedData.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/ageReader/AgeReaderQualification.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/user/Department.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Strategy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmAppliedStrategy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/ReferenceTaxonStrategy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedStrategy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/AppliedPeriod.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Person.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Program.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/AcquisitionLevel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/BatchModelAppliedStrategy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/Program2Department.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/ProgramPrivilege.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/administration/programStrategy/PmfmStrategy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingVesselHierarchy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/grouping/GroupingItemHierarchy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchyException.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/technical/optimization/location/LocationHierarchy.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/DepthGradient.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/NearbySpecificArea.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea2RegulationLocation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/RegulationArea.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/Corpus.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/CorpusType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/RightToProduce.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/MinimumSizeAllowed.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/regulation/Fishery.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/seller/SellerType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/seller/Seller.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/PrecisionType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSystem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingItemType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/transcribing/TranscribingSide.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/ProcessingStatus.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/DistanceToCoastGradient.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemLine.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemArea.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItem2Location.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/spatial/SpatialItemPoint.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/SurveyQualification.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/VesselType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/ObjectType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/Status.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/ProcessingType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/LinkedItemType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/GearClassification.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/GearClassificationAssociation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/GearAssociation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/gear/Gear.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/Location.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/LocationClassification.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/LocationLevel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/location/LocationAssociation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/samplingScheme/denormalized/DenormalizedSamplingStrata.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/buyer/Buyer.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/buyer/BuyerType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/GroupingClassification.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/GroupingItem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/Grouping.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/grouping/GroupingLevel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/PhotoType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/SaleType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroup.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupHistoricalRecord.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/ReferenceDocument.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Citation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonGroupInformation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonNameHistory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/Author.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/ReferenceTaxon.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonInformationHistory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonName.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonomicLevel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/taxon/VirtualComponent.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselOwner.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/EducationGrade.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselFeatures.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselRegistrationPeriod.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselOwnerPeriod.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselEngineType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselMasterPeriod.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/Vessel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/vessel/VesselMaster.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/metier/Metier.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/order/OrderItem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/order/OrderType.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/conversion/UnitConversion.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/conversion/WeightLengthConversion.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/conversion/RoundWeightConversion.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/qualification/QualificationRule.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Matrix.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Unit.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/ParameterGroup.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Fraction.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Method.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Pmfm.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/Parameter.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/AggregationLevel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/pmfm/QualitativeValue.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/NumericalPrecision.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/QualityFlag.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/referential/AnalysisInstrument.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/BatchExhaustiveInventory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/BatchModel.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/Batch.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalizedBatch.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/batch/denormalized/DenormalisedBatchSortingValue.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/qualification/AppliedQualificationRule.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/qualification/QualifiedItem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/takeOver/TakeOver.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/physicalGear/PhysicalGearSurvey.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/declaration/DeclaredDocumentReference.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/economy/EconomicalSurvey.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/activity/ActivityCalendar.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/activity/DailyActivityCalendar.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/sale/SaleOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/sale/Sale.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTrip.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/fishingTrip/FishingTripOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/scientificCruise/ScientificCruise.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/fishingEffort/FishingEffortCalendar.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/landing/LandingOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/survey/landing/Landing.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/sale/ExpectedSale.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea2RegulationLocation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/fishingArea/FishingArea.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/operation/denormalized/DenormalizedOperation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/operation/Operation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/operation/OperationVesselAssociation.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/sample/Sample.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/transshipment/Transshipment.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/LandingMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/VesselPhysicalMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/QuantificationMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/VesselUseMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/file/MeasurementFile.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/VesselPositionMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SaleMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/photo/Photo.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/TakeOverMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/GearUseMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SortingMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SampleMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/SurveyMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/measure/GearPhysicalMeasurement.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/link/LinkedItem.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/produce/Produce.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/UpdatedItemHistory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/InsertedItemHistory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/ProcessingHistory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/history/DeletedItemHistory.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/position/VesselPosition.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeatures.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeaturesOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/VesselPhysicalFeatures.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/physical/GearPhysicalFeaturesOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeaturesOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeaturesOrigin.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/VesselUseFeatures.hbm.xml</value> + <value>file:/home/tchemit/projets/ifremer/adagio/core/target/generated-sources/java/fr/ifremer/adagio/core/dao/data/vessel/feature/use/GearUseFeatures.hbm.xml</value> + </list> + </property--> + <!--</bean>--> + </beans> \ No newline at end of file Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml =================================================================== --- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-09 18:34:01 UTC (rev 161) @@ -28,42 +28,386 @@ <hibernate-mapping> <!--<fetch-profile name="tutti">--> - <!--TODO Create fetch profile to avoid eager loading --> + <!--TODO Create fetch profile to avoid eager loading --> <!--</fetch-profile>--> - <!-- Exemple HQL : > - <query cacheable="true" - name="selectProgramFromUser">select distinct - p.code, - p.name, - p.description - from - Program as p - left outer join p.program2persons as users - left outer join p.program2departments as dep - left outer join dep.department.persons as depUsers - where - users.person.id=:userId - or depUsers.id=:userId<query-param - name="userId" type="java.lang.Integer"/> - </query--> + <!-- Get all program zones [REF-01] --> + <query cacheable="true" name="allProgramZones"> + <![CDATA[ + SELECT + l.id, + l.label, + l.name, + l.status + FROM LocationImpl l + WHERE + l.locationLevel.id = :locationLevelId + AND l.status.code IN (1, 2) + ]]> + <query-param name="locationLevelId" type="java.lang.Integer"/> + </query> - <query cacheable="true" name="getAllScientificVessels"> - FROM VesselImpl WHERE vesselType.id=8 + <!-- Get all countries [REF-02] --> + <query cacheable="true" name="allCountries"> + <![CDATA[ + SELECT + l.id, + l.label, + l.name, + l.status + FROM LocationImpl l + WHERE + l.locationLevel.id = :locationLevelId + AND l.status.code IN (1, 2) + ]]> + <query-param name="locationLevelId" type="java.lang.Integer"/> + </query> + <!-- Get all vessel for a given vesselType [REF-03] et [REF-04]--> + <query cacheable="true" name="allVessels"> + <![CDATA[ + SELECT + v.code AS vesselCode, + vrp.registrationCode AS nationalRegistrationCode, + vrp.internationalRegistrationCode as internationalRegistrationCode, + vf.name AS vesselName, + v.status AS status + FROM + VesselImpl v + INNER JOIN v.vesselRegistrationPeriods AS vrp + LEFT OUTER JOIN v.vesselFeatures AS vf + WHERE v.vesselType.id = :vesselTypeId + AND v.status.code IN (1, 2) + AND vrp.vesselRegistrationPeriodPk.startDateTime = + ( + SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime) + FROM VesselRegistrationPeriodImpl vrp2 WHERE + vrp2.vesselRegistrationPeriodPk.vessel.code = v.code + AND (vrp2.vesselRegistrationPeriodPk.startDateTime <= :refDate OR :refDate IS NULL) + GROUP BY vrp2.vesselRegistrationPeriodPk.vessel.code + ) + AND vf.startDateTime = + ( + SELECT MAX(vf2.startDateTime) + FROM VesselFeaturesImpl vf2 WHERE + vf2.vessel.code = v.code + AND (vf2.startDateTime <= :refDate OR :refDate IS NULL) + GROUP BY vf2.vessel.code + )]]> + <query-param name="vesselTypeId" type="java.lang.Integer"/> + <query-param name="refDate" type="java.util.Date"/> </query> - <query cacheable="true" name="getAllFishingVessels"> - FROM VesselImpl WHERE vesselType.id=1 + <!-- Get all gears [REF-05] and [REF-06] --> + <query cacheable="true" name="allGears"> + <![CDATA[ + SELECT + g.id, + g.label, + g.name, + g.status AS status + FROM GearImpl g + WHERE + g.gearClassification.id= :gearClassificiationId + AND g.status.code IN (1, 2) + ]]> + <query-param name="gearClassificiationId" type="java.lang.Integer"/> </query> - <query cacheable="true" name="getAllGears"> - FROM GearImpl + <!-- Get all persons [REF-07] --> + <query cacheable="true" name="allPersons"> + <![CDATA[ + SELECT DISTINCT + p.id, + p.firstname, + p.lastname, + p.department, + p.status + FROM + PersonImpl p + WHERE p.status.code IN (1, 2) + ]]> </query> - <query cacheable="true" name="getPmfm"> - FROM GearImpl + <!-- TODO Fix it! Get all species [REF-08] --> + <query cacheable="true" name="allSpecies"> + <![CDATA[ + SELECT + t.id, + t.label, + t.name, + t.status + FROM TaxonGroupImpl t + WHERE t.taxonGroupType.code = :taxonGroupCode + AND t.isChildGroupExclusive = false + AND t.status.code IN (1, 2) + ]]> + <query-param name="taxonGroupCode" type="java.lang.Integer"/> </query> + <!-- TODO Fix it! Get one species [REF-08-1] --> + <query cacheable="true" name="species"> + <![CDATA[ + SELECT + t.id, + t.label, + t.name, + t.status + FROM TaxonGroupImpl t + WHERE t.id = :speciesId + ]]> + <query-param name="speciesId" type="java.lang.Integer"/> + </query> + <!-- TODO Fix it! Get all length step catacteristics [REF-09] --> + <query cacheable="true" name="allLengthStepCaracteristics"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.parameter.code LIKE 'LENGTH_%' AND p.matrix.id = :matrixId + ]]> + <query-param name="matrixId" type="java.lang.Integer"/> + </query> + + <!-- Get all gear caracteristics [REF-10] (use allPmfmsByMatrixId) --> + <!--query cacheable="true" name="allGearFeaturesCaracteristics"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.matrix.id= :matrixId + ]]> + <query-param name="matrixId" type="java.lang.Integer"/> + </query--> + + <!-- Get all environment caracteristics [REF-11] (use allPmfmsByParameterGroudId) --> + <!--query cacheable="true" name="allEnvironmentCaracteristics"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.parameter.parameterGroup.id= :parameterGroupId + ]]> + <query-param name="parameterGroupId" type="java.lang.Integer"/> + </query--> + + <!-- TODO FIX IT! Get all hydrology caracteristics [REF-12] (use allPmfmsByParameterGroudId) --> + <!--query cacheable="true" name="allHydrologyCaracteristics"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.parameter.parameterGroup.id= :parameterGroupId + ]]> + <query-param name="parameterGroupId" type="java.lang.Integer"/> + </query--> + + <!-- Get all fishing operation strates [REF-13] --> + <query cacheable="true" name="allFishingOperationStratas"> + <![CDATA[ + SELECT + l.id as locationId, + l.label as locationLabel, + l.name as locationName, + l.locationLevel.id as locationLevelId, + l.status as status + FROM LocationImpl l + WHERE l.status.code IN (1, 2) + AND l.locationLevel.id = :locationLevelId + ]]> + <query-param name="locationLevel" type="java.lang.Integer"/> + </query> + + <!-- Get all fishing operation substrates [REF-14] --> + <query cacheable="true" name="allFishingOperationSubStratas"> + <![CDATA[ + SELECT + l.id as locationId, + l.label as locationLabel, + l.name as locationName, + l.locationLevel.id as locationLevelId, + l.status as status + FROM LocationImpl l + WHERE l.status.code IN (1, 2) + AND l.locationLevel.id = :locationLevelId + ]]> + </query> + + <!-- Get all fishing operation locaties [REF-15] --> + <query cacheable="true" name="allFishingOperationLocalites"> + <![CDATA[ + SELECT + l.id as locationId, + l.label as locationLabel, + l.name as locationName, + l.locationLevel.id as locationLevelId, + l.status as status + FROM LocationImpl l + WHERE l.status.code IN (1, 2) + AND l.locationLevel.id = :locationLevelId + ]]> + </query> + + <!-- TODO Fix it! Get all Length - Weight conversions [REF-16] --> + <!--query cacheable="true" name="allLengthWeightConvertions"> + <![CDATA[]]> + </query--> + + <!-- TODO Fix it! Get all benthos species [REF-17] --> + <query cacheable="true" name="allBenthosSpecies"> + <![CDATA[ + SELECT + t.id, + t.label, + t.name, + t.status + FROM TaxonGroupImpl t + WHERE t.taxonGroupType.code = :taxonGroupCode + AND t.isChildGroupExclusive = false + AND t.status.code IN (1, 2) + ]]> + <query-param name="taxonGroupCode" type="java.lang.Integer"/> + </query> + + <!-- TODO Fix it! Get all plankton species [REF-18] TODO --> + <query cacheable="true" name="allPlanktonSpecies"> + <![CDATA[ + SELECT + t.id, + t.label, + t.name, + t.status + FROM TaxonGroupImpl t + WHERE t.taxonGroupType.code = :taxonGroupCode + AND t.isChildGroupExclusive = false + AND t.status.code IN (1, 2) + ]]> + <query-param name="taxonGroupCode" type="java.lang.Integer"/> + </query> + + <!-- Get all macroWaste categories [REF-19] (use pmfmById + pmfmQualitativeValues) --> + <!--query cacheable="true" name="allMacroWasteCategories"> + <![CDATA[ + ]]> + </query--> + + <!-- Get all macroWaste size categories [REF-20] (use pmfmById + pmfmQualitativeValues) --> + <!--query cacheable="true" name="allMacroWasteSizeCategories"> + <![CDATA[ + ]]> + </query--> + + <!-- Get a pmfm caracteristics by this id [REF-24] --> + <query cacheable="true" name="pmfmById"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.id= :pmfmId + ]]> + <query-param name="pmfmId" type="java.lang.Integer"/> + </query> + + <!-- Get a pmfm qualitative values from his id [REF-25] --> + <query cacheable="true" name="pmfmQualitativeValues"> + <![CDATA[ + SELECT + qv.id AS id, + case when (qv.name = qv.description) then qv.name else concat(qv.name, ' - ', qv.description) end AS name, + qv.status AS status + FROM + PmfmImpl p JOIN p.qualitativeValues qv + WHERE p.id= :pmfmId + AND qv.status.code IN (1, 2) + ]]> + <query-param name="pmfmId" type="java.lang.Integer"/> + </query> + + <!-- Get all pmfms using a same matrix Id --> + <query cacheable="true" name="allPmfmsByMatrixId"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.matrix.id= :matrixId + ]]> + <query-param name="matrixId" type="java.lang.Integer"/> + </query> + + <!-- Get all pmfms using a same parameter group id --> + <query cacheable="true" name="allPmfmsByParameterGroudId"> + <![CDATA[ + SELECT + p.id AS pmfmId, + p.parameter.name AS parameterName, + p.matrix.name AS matrixName, + p.fraction.name AS fractionName, + p.method.name AS methodName, + p.parameter.isAlphanumeric AS isAlphanumeric, + p.parameter.isQualitative AS isQualitative, + p.unit.symbol AS symbol, + p.status AS status + FROM PmfmImpl p + WHERE p.status.code IN (1, 2) + AND p.parameter.parameterGroup.id= :parameterGroupId + ]]> + <query-param name="parameterGroupId" type="java.lang.Integer"/> + </query> + + </hibernate-mapping> Modified: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties =================================================================== --- trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-09 18:34:01 UTC (rev 161) @@ -21,58 +21,59 @@ # <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### -# v3 Version de test +# Version de preprod -AcquisitionLevelCode.ACTIVITY=ACTIVITY +AcquisitionLevelCode.ACTIVITY=MONTHLY_ACTIVITY AcquisitionLevelCode.ACTIVITY_CALENDAR=ACTIVITY_CALENDAR -AcquisitionLevelCode.BATCH=LOT +AcquisitionLevelCode.BATCH=BATCH AcquisitionLevelCode.FISHING_EFFORT_CALENDAR=EFFORT_CALENDAR -AcquisitionLevelCode.FISHING_OPERATION=OPER_PREL +AcquisitionLevelCode.FISHING_OPERATION=OPERATION AcquisitionLevelCode.FISHING_TRIP=FISHING_TRIP -AcquisitionLevelCode.FISHING_TRIP_PHYSICAL_GEAR=OBSERVED_PHYSICAL_GEAR +AcquisitionLevelCode.FISHING_TRIP_PHYSICAL_GEAR=OBSERVED_FISHING_TRIP_PHYSICAL_GEAR AcquisitionLevelCode.LANDING=LANDING -AcquisitionLevelCode.MONTHLY_EFFORT=EFFORT_MENS +AcquisitionLevelCode.MONTHLY_EFFORT=MONTHLY_FISHING_EFFORT AcquisitionLevelCode.OBSERVED_LANDING=OBSERVED_LANDING AcquisitionLevelCode.OBSERVED_SALE=OBSERVED_SALE -AcquisitionLevelCode.OBSERVED_TRIP_ON_BOARD=MAREE_OBSERV_MER -AcquisitionLevelCode.OPERATION=OPER +AcquisitionLevelCode.OBSERVED_TRIP_ON_BOARD=OBSERVED_FISHING_TRIP +AcquisitionLevelCode.OPERATION=OPERATION_fake AcquisitionLevelCode.OPERATION_GROUP=OPERATION_GROUP -AcquisitionLevelCode.PHYSICAL_GEAR=PHYS_GEAR +AcquisitionLevelCode.PHYSICAL_GEAR=PHYSICAL_GEAR_SURVEY AcquisitionLevelCode.SALE=SALE AcquisitionLevelCode.SALE_SURVEY=SALE_SURVEY -AcquisitionLevelCode.SAMPLE=ECHANT +AcquisitionLevelCode.SAMPLE=SAMPLE AcquisitionLevelCode.SCIENTIFIC_CRUISE=SCIENTIFIC_CRUISE AcquisitionLevelCode.VESSEL_PHYSICALFEATURES=VESSEL_PHYSICAL_FEATURES -AcquisitionLevelCode.YEARLYEFFORT=EFFORT_ANN +AcquisitionLevelCode.YEARLYEFFORT=YEARLY_FISHING_EFFORT AcquisitionLevelCode.CONTROLS_REFERENTIAL=CONTROLS_REFERENTIAL -ActivityCalendarNumericalPmfmIds.GREATER_VALUE_PMFM=82 -ActivityCalendarNumericalPmfmIds.LOWER_VALUE_PMFM=85 -AggregationLevelId.DAY=1 -AggregationLevelId.FISHING_TRIP=6 -AggregationLevelId.HOUR=7 -AggregationLevelId.MONTH=2 -AggregationLevelId.NONE=0 -AggregationLevelId.SEMESTER=4 -AggregationLevelId.TRIMESTER=3 -AggregationLevelId.YEAR=5 +ActivityCalendarNumericalPmfmIds.GREATER_VALUE_PMFM=241 +ActivityCalendarNumericalPmfmIds.LOWER_VALUE_PMFM=242 +AggregationLevelId.DAY=4 +AggregationLevelId.FISHING_TRIP=9 +AggregationLevelId.HOUR=3 +AggregationLevelId.MONTH=21 +AggregationLevelId.NONE=1 +AggregationLevelId.SEMESTER=7 +AggregationLevelId.TRIMESTER=6 +AggregationLevelId.YEAR=8 CriteriaType.DEFAULT=0 CriteriaType.EXISTS=3 CriteriaType.JOIN=1 CriteriaType.NOT_EXISTS=4 CriteriaType.SELECT=2 -DepartmentCode.OUTSIDE=EXT +DepartmentCode.OUTSIDE=EXTERIEUR +Filters.RESULTS_SIZE_WARNING_VALUE=10000 FractionId.ALL=1 FractionId.GEAR=2 -GearClassificationId.CNTS=3 -GearClassificationId.EU=2 +GearClassificationId.CNTS=5 +GearClassificationId.EU=4 GearClassificationId.FAO=1 GearClassificationId.SCIENTIFIC_CRUISE=5 -GearUseFeaturesOriginMapping.ACTIVITY_CALENDAR=<PROGRAM> N-1|<PROGRAM>,Enquêteur|<INVESTIGATOR>,Déclaratif|<DECLARATIVE>,Ventes|SIH_OBSMER -GearUseFeaturesOriginMapping.EFFORT_CALENDAR=<PROGRAM> N-1|<PROGRAM>,Enquêteur|<INVESTIGATOR>,Déclaratif|<DECLARATIVE>,Ventes|SIH_OBSMER +GearUseFeaturesOriginMapping.ACTIVITY_CALENDAR=Activit\u00E9 N-1|<PROGRAM>,Enqu\u00EAteur|<INVESTIGATOR>,Document d\u00E9claratif|<DECLARATIVE>,Ventes|OFIMER +GearUseFeaturesOriginMapping.EFFORT_CALENDAR=Activit\u00E9 N-1|<PROGRAM>,Enqu\u00EAteur|<INVESTIGATOR>,Document d\u00E9claratif|<DECLARATIVE>,Ventes|OFIMER isActive.ACTIVE=1 isActive.INACTIVE=0 isActive.NOT_EXISTS=2 -LocationClassificationId.REGULATION=4 +LocationClassificationId.REGULATION=3 LocationClassificationId.SECTOR=2 LocationClassificationId.TERRITORIAL=1 LocationLabel.FRANCE=FRA @@ -88,49 +89,49 @@ LocationLevelId.SOUS_RECTANGLE_STATISTIQUE=114 ManageDataTypeId.ACTIVITY_CALENDAR=4 ManageDataTypeId.OBSERVED_FISHING_TRIP_ON_BOARD=5 -ManageDataTypeId.PHYSICAL_GEAR_SURVEY=6 -ManageDataTypeId.SALE=7 -ManageDataTypeId.SCIENTIFIC_CRUISE=8 -MatrixId.FISHING_METIER=10 -MatrixId.GEAR=2 -MatrixId.OPERATION=7 -MatrixId.VESSEL=8 +ManageDataTypeId.PHYSICAL_GEAR_SURVEY=7 +ManageDataTypeId.SALE=8 +ManageDataTypeId.SCIENTIFIC_CRUISE=9 +MatrixId.FISHING_METIER=6 +MatrixId.GEAR=3 +MatrixId.OPERATION=21 +MatrixId.VESSEL=5 MatrixId.SUPPORT_WITH_GEAR=17 MatrixId.SUPPORT_WITH_METIER=18 -MethodId.ALIVE_WEIGHT_EQUIVALENT=6 -MethodId.ESTIMATED=2 -MethodId.HEIGHT_WEIGHT=7 -MethodId.TOTAL_BATCH=17 +MethodId.ALIVE_WEIGHT_EQUIVALENT=5 +MethodId.ESTIMATED=45 +MethodId.HEIGHT_WEIGHT=47 +MethodId.TOTAL_BATCH=283 OrderTypeId.NORTH_SOUTH_LOCATION_RANK=1 -ParameterCode.ANOTHER_SURVEY=AUTRE_ENQ -ParameterCode.BULK=VRAC/HORS VRAC -ParameterCode.CALCULATED_WEIGHT=POIDS_CALCULE +ParameterCode.ANOTHER_SURVEY=ACCEPT_OTHER_SURVEY +ParameterCode.BULK=SORTED +ParameterCode.CALCULATED_WEIGHT=WEIGHT_CALCULATED ParameterCode.CONTRACT_CODE=CONTRACT_CODE -ParameterCode.CREW_SIZE=NB_HOMME_BORD -ParameterCode.DATA_RELIABILITY=FIAB_DATA +ParameterCode.CREW_SIZE=CREW_SIZE +ParameterCode.DATA_RELIABILITY=SURVEY_RELIABILITY ParameterCode.DISCARD_TYPE=DISCARD_TYPE -ParameterCode.ENGIN_TIME=NB_HEURES_MOTEUR -ParameterCode.FISHING_DAY_COUNT=NB_JOURS_PECHE -ParameterCode.GEAR_DEPTH=PROF +ParameterCode.ENGIN_TIME=ENGIN_DURATION +ParameterCode.FISHING_DAY_COUNT=FISHING_DURATION +ParameterCode.GEAR_DEPTH=GEAR_DEPTH ParameterCode.IS_SAMPLING=IS_SAMPLING -ParameterCode.LANDING_REJECTION=DEB/REJ -ParameterCode.PRESENTATION=PRES -ParameterCode.PROCEEDING=DEROULEMENT -ParameterCode.RECEPTION_QUALITY=QUALIT_ACC -ParameterCode.SEA_DAY_COUNT=NB_JOURS_MER -ParameterCode.SEA_STATE=ETAT_MER -ParameterCode.SEX=SEXE -ParameterCode.SIZE=TAILLE -ParameterCode.STATUS=ETAT -ParameterCode.SURVEY_QUALIFICATION=QUALIF_ENQ -ParameterCode.VALIDATION_PROGRAM=VALIDPRO -ParameterCode.VALIDATION_SUPERVISOR=VALIDSUP -ParameterCode.WEIGHT=POIDS -ParameterCode.SIZE_UNLI_CAT=CATEGORIE +ParameterCode.LANDING_REJECTION=DISCARD_OR_LANDING +ParameterCode.PRESENTATION=DRESSING +ParameterCode.PROCEEDING=TRIP_PROGRESS +ParameterCode.RECEPTION_QUALITY=WELCOME_QUALITY +ParameterCode.SEA_DAY_COUNT=DURATION_AT_SEA +ParameterCode.SEA_STATE=SEA_STATE +ParameterCode.SEX=SEX +ParameterCode.SIZE=LENGTH_TOTAL +ParameterCode.STATUS=QUALITY +ParameterCode.SURVEY_QUALIFICATION=SURVEY_QUALIFICATION +ParameterCode.VALIDATION_PROGRAM=IS_VALIDATED_PRG +ParameterCode.VALIDATION_SUPERVISOR=IS_VALIDATED +ParameterCode.WEIGHT=WEIGHT +ParameterCode.SIZE_UNLI_CAT=SIZE_UNLI_CAT ParameterCode.SIZE_UE_CAT=SIZE_UE_CAT ParameterCode.CASE=CASE ParameterCode.SORTING_TYPE=SORTING_TYPE -ParameterCode.PRESERVATION=ETAT +ParameterCode.PRESERVATION=PRESERVATION ParameterCode.DRESSING=DRESSING ParameterCode.AGE=AGE ParameterCode.LENGTH_TOTAL=LENGTH_TOTAL @@ -167,60 +168,60 @@ ParameterCode.WARP_LENGTH=WARP_LENGTH ParameterCode.CIRCUMFERENCE=CIRCUMFERENCE ParameterCode.WIDTH=WIDTH -ParameterGroupId.SURVEY_MEASUREMENT=6 -PmfmId.ALIVE_WEIGHT_CALCULATED=POIDS_CALCULE;6;1;6 -PmfmId.CALCULATED_WEIGHT_CHILDREN_SUM=POIDS_CALCULE;6;1;24 -PmfmId.WEIGHT_SIZE_CALCULATED=POIDS_CALCULE;6;1;7 -PmfmId.WEIGHT_SIZE_EXTRAPOLATE=POIDS_CALCULE;6;1;21 -PmfmId.WEIGHT_TOTAL_CALCULATED=POIDS_CALCULE;6;1;17 +ParameterGroupId.SURVEY_MEASUREMENT=21 +PmfmId.ALIVE_WEIGHT_CALCULATED=WEIGHT_CALCULATED;1;1;5 +PmfmId.CALCULATED_WEIGHT_CHILDREN_SUM=WEIGHT_CALCULATED;1;1;341 +PmfmId.WEIGHT_SIZE_CALCULATED=WEIGHT_CALCULATED;1;1;47 +PmfmId.WEIGHT_SIZE_EXTRAPOLATE=WEIGHT_CALCULATED;1;1;283 +PmfmId.WEIGHT_TOTAL_CALCULATED=WEIGHT_CALCULATED;1;1;22 PmfmId.MAX_DURATION_FOR_OPERATION_WITH_GEAR=DUREE_MAX_OPERATION;17;1;1 PmfmId.MAX_DISTANCE_FOR_OPERATION_WITH_GEAR=DISTANCE_MAX_OPERATION;17;1;1 PmfmId.MAX_DURATION_FOR_OPERATION_WITH_METIER=DUREE_MAX_OPERATION;18;1;1 PmfmId.MAX_DISTANCE_FOR_OPERATION_WITH_METIER=DISTANCE_MAX_OPERATION;18;1;1 -PmfmId.STORAGE_STATE=CLOSE_OBSVENTE_STOCK;19;11;1 -ProgramCode.ACTIVITY=SIH_STATPECHE -ProgramCode.ACTIVITY_MERGE=SIH_STATPECHE_CONFLIT -ProgramCode.DECLARATIVE_FLOW=SIPA +PmfmId.STORAGE_STATE=CLOSE_OBSVENTE_STOCK;61;61;21 +ProgramCode.ACTIVITY=SIH-ACTIFLOT +ProgramCode.ACTIVITY_MERGE=SIH-ACTIFLOT-CONFLIT +ProgramCode.DECLARATIVE_FLOW=SIH-ACTIPRED ProgramCode.PRE_RECOPESCA=SIH-preRECOPESCA ProgramCode.RECOPESCA=SIH-RECOPESCA -ProgramCode.SIH_OBSERVED_FISHING_TRIP_ON_BOARD=SIH_OBSMER -ProgramCode.SIH_OBSMER=SIH_OBSMER -ProgramCode.SIH_STATPECHE_CONFLIT=SIH_STATPECHE_CONFLIT -ProgramCode.STAT_PECHE=SIH_STATPECHE -SaleDateControlByProgram.MAX_DAYS_AFTER_FISHING_TRIP=SIH_OBSMER|3,SIH_OBSVENTE|3 -BatchControl.SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT=PRES,SIZE_UNLI_CAT,SEXE -BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT=SIH_OBSMER|50,SIH_OBSVENTE|50 -BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN=SIH_OBSMER|5,SIH_OBSVENTE|5 -BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT=SIH_OBSMER|100,SIH_OBSVENTE|100 -BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX=SIH_OBSMER|5,SIH_OBSVENTE|5 -ProgramManagedDataTypeMapping.FISHING_TRIP=SIH_OBSMER|5 -ProgramManagedDataTypeMapping.SALE=SIH_OBSVENTE|7 -ProgramObjectTypeMapping.FISHING_TRIP=SIH_OBSMER|OBSERVED_FISHING_TRIP -ProgramObjectTypeMapping.SALE=SIH_OBSVENTE|OBSERVED_SALE +ProgramCode.SIH_OBSERVED_FISHING_TRIP_ON_BOARD=SIH-OBSMER +ProgramCode.SIH_OBSMER=SIH-OBSMER +ProgramCode.SIH_STATPECHE_CONFLIT=SIH-ACTIFLOT-CONFLIT +ProgramCode.STAT_PECHE=SIH-ACTIFLOT +SaleDateControlByProgram.MAX_DAYS_AFTER_FISHING_TRIP=SIH-OBSMER|3,SIH-OBSVENTE|3 +BatchControl.SORTING_CRITERIA_PARAMETER_NEEDS_REFERENCE_WEIGHT=DRESSING,SIZE_UNLI_CAT,SEX +BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_THRESHOLD_PERCENT=SIH-OBSMER|50,SIH-OBSVENTE|50 +BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE1_KILO_MIN=SIH-OBSMER|5,SIH-OBSVENTE|5 +BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_THRESHOLD_PERCENT=SIH-OBSMER|100,SIH-OBSVENTE|100 +BatchControl.CHILDREN_SUM_DIFFERENCE_BETWEEN_REFERENCE_AND_SIZE_WEIGHT_RULE2_KILO_MAX=SIH-OBSMER|5,SIH-OBSVENTE|5 +ProgramManagedDataTypeMapping.FISHING_TRIP=SIH-OBSMER|5 +ProgramManagedDataTypeMapping.SALE=SIH-OBSVENTE|8 +ProgramObjectTypeMapping.FISHING_TRIP=SIH-OBSMER|OBSERVED_FISHING_TRIP +ProgramObjectTypeMapping.SALE=SIH-OBSVENTE|OBSERVED_SALE ProgramPrivilegeId.MANAGER=1 ProgramPrivilegeId.QUALIFICATOR=5 ProgramPrivilegeId.RECORDER=2 ProgramPrivilegeId.VALIDATOR=4 ProgramPrivilegeId.VIEWER=3 -QualitativeValueId.ABNORMAL=28 -QualitativeValueId.ANOTHER_SURVEY_NO=34 -QualitativeValueId.ANOTHER_SURVEY_YES=33 -QualitativeValueId.DIRECT_SURVEY=49 -QualitativeValueId.DISCARD_TYPE_ANIMALS=48 -QualitativeValueId.ESTIMATE_SURVEY=51 -QualitativeValueId.FRY_STATUS=31 -QualitativeValueId.INDIRECT_SURVEY=50 -QualitativeValueId.INTEGRAL_PRESENTATION=7 -QualitativeValueId.IS_SAMPLING=56 -QualitativeValueId.LANDING=3 -QualitativeValueId.NON_SEXED_SEX=55 -QualitativeValueId.VALIDATION_PROGRAM_DO_CORRECTION=2162 -QualitativeValueId.VALIDATION_SUPERVISOR_NO=2151 -QualitativeValueId.VALIDATION_SUPERVISOR_YES=2150 -QualitativeValueId.SORTING_TYPE_TPN=71 -QualitativeValueId.SORTING_TYPE_TCC=70 -QualitativeValueId.REJECTED=4 -QualitativeValueId.VRAC=1 +QualitativeValueId.ABNORMAL=328 +QualitativeValueId.ANOTHER_SURVEY_NO=847 +QualitativeValueId.ANOTHER_SURVEY_YES=846 +QualitativeValueId.DIRECT_SURVEY=965 +QualitativeValueId.DISCARD_TYPE_ANIMALS=407 +QualitativeValueId.ESTIMATE_SURVEY=967 +QualitativeValueId.FRY_STATUS=142 +QualitativeValueId.INDIRECT_SURVEY=966 +QualitativeValueId.INTEGRAL_PRESENTATION=139 +QualitativeValueId.IS_SAMPLING=415 +QualitativeValueId.LANDING=203 +QualitativeValueId.NON_SEXED_SEX=302 +QualitativeValueId.VALIDATION_PROGRAM_DO_CORRECTION=942 +QualitativeValueId.VALIDATION_SUPERVISOR_NO=418 +QualitativeValueId.VALIDATION_SUPERVISOR_YES=417 +QualitativeValueId.SORTING_TYPE_TPN=1746 +QualitativeValueId.SORTING_TYPE_TCC=1747 +QualitativeValueId.REJECTED=204 +QualitativeValueId.VRAC=311 QualityFlagCode.BAD=4 QualityFlagCode.CORRECTED=5 QualityFlagCode.DOUBTFUL=3 @@ -246,37 +247,37 @@ SaleTypeId.SUPERMARCHE=-4 SaleTypeId.TRANSFORMATEUR=3 SaleTypeId.VENTE_PARTICULIER=-1 -SamplingSchemeControl.MANDATORY_PROGRAM_LIST=SIH_OBSMER,SIH_OBSVENTE +SamplingSchemeControl.MANDATORY_PROGRAM_LIST=SIH-OBSVENTE SpatialItemTypeId.DEPTH_GRADIENT=1 SpatialItemTypeId.DISTANCE_TO_COAST_GRADIENT=3 -SpatialItemTypeId.GEAR=4 +SpatialItemTypeId.GEAR=5 SpatialItemTypeId.METIER=7 SpatialItemTypeId.NEARBY_SPECIFIC_AREA=2 -SpatialItemTypeId.TAXON_GROUP=5 +SpatialItemTypeId.TAXON_GROUP=4 StatusCode.DELETED=3 StatusCode.DISABLE=0 StatusCode.ENABLE=1 StatusCode.TEMPORARY=2 StorageStateValues.CLOSED=69 -SurveyQualificationId.DIRECT=1 -SurveyQualificationId.ESTIMATION=3 -SurveyQualificationId.INDIRECT=2 -SurveyQualificationId.PREDOCUMENTATION=4 +SurveyQualificationId.DIRECT=0 +SurveyQualificationId.ESTIMATION=0 +SurveyQualificationId.INDIRECT=0 +SurveyQualificationId.PREDOCUMENTATION=0 SurveyQualificationId.UNKNOWN=0 SynchronizationStatus.DELETED=DELETED SynchronizationStatus.DIRTY=DIRTY SynchronizationStatus.READY_TO_SYNCHRONIZE=READY_TO_SYNC SynchronizationStatus.SYNCHRONIZED=SYNC -TaxonGroupId.FISH=8 -TaxonGroupTypeCode.COMMERCIAL_SPECIES=1 -TaxonGroupTypeCode.METIER_SPECIES=2 -TaxonomicLevelCode.SPECIES=5 -TaxonomicLevelCode.VARIETY=6 +TaxonGroupId.FISH=1712 +TaxonGroupTypeCode.COMMERCIAL_SPECIES=2 +TaxonGroupTypeCode.METIER_SPECIES=3 +TaxonomicLevelCode.SPECIES=SPECIES +TaxonomicLevelCode.VARIETY=SUBSPECIES TranscribingSideId.IN=2 TranscribingSideId.IN_OUT=3 TranscribingSideId.OUT=1 TranscribingSystemId.FAO=4 -TranscribingSystemId.HARMONIE=1 +TranscribingSystemId.HARMONIE=5 TranscribingSystemId.OFIMER=3 TranscribingSystemId.SIPA=2 UnitId.DAY=17 @@ -290,8 +291,38 @@ VesselTypeId.FISHING_VESSEL=1 VesselTypeId.FISHING_VESSEL_GROUP=2 VesselTypeId.PLEASURE_BOAT=4 -VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL=5 +VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL=8 VesselTypeId.SHELLFISH_GATHERER=3 -ZoneCompetenceMapping.GROUND=Finistère|506;516,Méditerranée|408;391 -ZoneCompetenceMapping.SEA=Finistère|4018,Méditerranée|4022 -ZoneCompetenceMapping.DEFAULT_LOCATION_LEVEL=Finistère|113;114,Méditerranée|142 +ZoneCompetenceMapping.GROUND=Corse|394;391,Guadeloupe|430,Guyanne|423,La Réunion|433,Martinique|425,Mayotte|424;429,Méditerranée|408;410;420;415;419;415;419,Mer du nord manche atlantique|386;387;388;389;390;392;393;395;396;397;398;399;400;401;402;403;404;405;406;407;409;411;412;414;416;417;418;421;422;432;435;436,Saint Pierre et Miquelon|434 +ZoneCompetenceMapping.SEA=Corse|4022,Guadeloupe|4020,Guyanne|4020,La Réunion|4028,Martinique|4020,Mayotte|4028,Méditerranée|4022,Mer du nord manche atlantique|4018,Saint Pierre et Miquelon|4017 +ZoneCompetenceMapping.DEFAULT_LOCATION_LEVEL=Corse|142,Guadeloupe|158;159,Guyanne|154;156,La Réunion|151;152,Martinique|158;159,Mayotte|,Méditerranée|142,Mer du nord manche atlantique|113;114,Saint Pierre et Miquelon|101 + +# Ajoute pour Tutti +LocationLevelId.LOCALITE=22 +LocationLevelId.STRATA=23 +#TODO Creer la bonne valeur +LocationLevelId.SUBSTRATA=-23 +#TODO Mettre la bonne valeur +LocationLevelId.PROGRAM=111 + +MatrixId.BATCH=1 + +ParameterGroupId.ENVIRONEMENT_MEASUREMENT=3 +#TODO Mettre la bonne valeur +ParameterGroupId.HYDROLOGIC_MEASUREMENT=3 +#TODO A creer +ParameterGroupId.LENGTH=3 + +PmfmId.SEX=196 +PmfmId.SIZE_CATEGORY=198 +PmfmId.SORTED_UNSORTED=200 +# TODO A confirmer +PmfmId.MATURITY=1181 +#TODO A créér +PmfmId.MACRO_WASTE_CATEGORY=1181 +#TODO A créér +PmfmId.MACRO_WASTE_SIZE_CATEGORY=1181 + + + + Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BaseDaoTest.java 2013-01-09 18:34:01 UTC (rev 161) @@ -68,7 +68,7 @@ @Before public void setUp() throws Exception { - config = TestUtil.createConfig(getClass(), name); + config = TestUtil.createConfig(getClass(), name.getMethodName()); if (log.isDebugEnabled()) { log.debug("Use conf.properties at " + config.getDbConfigurationPath()); Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/GearDaoTest.java 2013-01-09 18:34:01 UTC (rev 161) @@ -1,48 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $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 org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.Query; -import org.junit.Assert; -import org.junit.Test; - -import java.util.List; - -public class GearDaoTest extends BaseDaoTest { - - /** Logger. */ - private static final Log log = LogFactory.getLog(GearDaoTest.class); - - @Test - public void getAllGear() { - - Query query = getSession().getNamedQuery("getAllGears"); - - List gears = query.list(); - Assert.assertNotNull(gears); - } -} Added: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-09 18:34:01 UTC (rev 161) @@ -0,0 +1,241 @@ +package fr.ifremer.tutti.persistence; + +import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig; +import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; +import fr.ifremer.tutti.persistence.entities.referential.Country; +import fr.ifremer.tutti.persistence.entities.referential.Gear; +import fr.ifremer.tutti.persistence.entities.referential.Person; +import fr.ifremer.tutti.persistence.entities.referential.Species; +import fr.ifremer.tutti.persistence.entities.referential.Vessel; +import fr.ifremer.tutti.persistence.entities.referential.Zone; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.nuiton.util.ArgumentsParserException; +import org.springframework.context.ApplicationContext; + +import java.io.IOException; +import java.util.List; + +/** + * Test the referential service. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ReferentialTest { + + /** Logger. */ + private static final Log log = LogFactory.getLog(ReferentialTest.class); + + protected static TuttiPersistenceAdagioConfig config; + + protected static TuttiPersistence driver; + + @BeforeClass + public static void beforeClass() throws IOException, ArgumentsParserException { + + TestUtil.checkDbExists(); + + config = TestUtil.createConfig(ReferentialTest.class, ""); + + if (log.isDebugEnabled()) { + log.debug("Use conf.properties at " + config.getDbConfigurationPath()); + } + ApplicationContext context = TestUtil.createSpringContext(); + + driver = (TuttiPersistence) context.getBean("adagioPersistenceService"); + + driver.setEnumerations(config.getDbEnumerations()); + + driver.open(); + } + + @AfterClass + public static void afterClass() throws Exception { + + // push back old classLoader + TestUtil.resetClassLoader(); + + // close hibernate session if was used + if (driver != null) { + driver.close(); + } + } + + @Test + public void getAllProgramZone() { + List<Zone> result = driver.getAllProgramZone(); + Assert.assertNotNull(result); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getAllCountry() { + List<Country> result = driver.getAllCountry(); + Assert.assertNotNull(result); + Assert.assertEquals(240, result.size()); + } + + @Test + public void getAllScientificVessel() { + List<Vessel> result = driver.getAllScientificVessel(); + Assert.assertNotNull(result); + Assert.assertEquals(1, result.size()); + } + + //FIXME : requete trop longue (index manquant, trop de jointures?) + @Test + @Ignore + public void getAllFishingVessel() { + List<Vessel> result = driver.getAllFishingVessel(); + Assert.assertNotNull(result); + Assert.assertEquals(187, result.size()); + } + + @Test + public void getAllScientificGear() { + List<Gear> result = driver.getAllScientificGear(); + Assert.assertNotNull(result); + Assert.assertEquals(2, result.size()); + } + + @Test + public void getAllFishingGear() { + List<Gear> result = driver.getAllFishingGear(); + Assert.assertNotNull(result); + Assert.assertEquals(75, result.size()); + } + + @Test + public void getAllPerson() { + List<Person> result = driver.getAllPerson(); + Assert.assertNotNull(result); + Assert.assertEquals(226, result.size()); + } + + + @Test + public void getAllSpecies() { + List<Species> result = driver.getAllSpecies(); + Assert.assertNotNull(result); + Assert.assertEquals(156, result.size()); + } + + @Test + public void getAllBenthosSpecies() { + List<Species> result = driver.getAllBenthosSpecies(); + Assert.assertNotNull(result); + Assert.assertEquals(156, result.size()); + } + + @Test + public void getAllPlanktonSpecies() { + List<Species> result = driver.getAllPlanktonSpecies(); + Assert.assertNotNull(result); + Assert.assertEquals(156, result.size()); + } + + @Test + public void getSpecies(/*String speciesId*/) { + } + + @Test + public void getAllFishingOperationStrata(/*String zoneId*/) { + } + + @Test + public void getAllFishingOperationSubStrata(/*String locationId*/) { + } + + @Test + public void getAllFishingOperationLocation(/*String locationId*/) { + } + + @Test + public void getAllFishingOperationEnvironmentCaracteristic() { + List<Caracteristic> result = driver.getAllFishingOperationEnvironmentCaracteristic(); + Assert.assertNotNull(result); + Assert.assertEquals(40, result.size()); + } + + @Test + public void getAllFishingOperationGearCaracteristic() { + List<Caracteristic> result = driver.getAllFishingOperationGearCaracteristic(); + Assert.assertNotNull(result); + Assert.assertEquals(155, result.size()); + } + + @Test + public void getAllFishingOperationHydrologicCaracteristic() { + List<Caracteristic> result = driver.getAllFishingOperationHydrologicCaracteristic(); + Assert.assertNotNull(result); + Assert.assertEquals(40, result.size()); + } + + @Test + public void getAllSpeciesLengthStepCaracteristic() { + List<Caracteristic> result = driver.getAllSpeciesLengthStepCaracteristic(); + Assert.assertNotNull(result); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getSizeCategoryCaracteristic() { + Caracteristic result = driver.getSizeCategoryCaracteristic(); + Assert.assertNotNull(result); + Assert.assertTrue(result.isQualitativeType()); + Assert.assertNotNull(result.getQualitativeValue()); + Assert.assertEquals(6, result.sizeQualitativeValue()); + } + + @Test + public void getSexCaracteristic() { + Caracteristic result = driver.getSexCaracteristic(); + Assert.assertNotNull(result); + Assert.assertTrue(result.isQualitativeType()); + Assert.assertNotNull(result.getQualitativeValue()); + Assert.assertEquals(4, result.sizeQualitativeValue()); + } + + @Test + public void getSortedUnsortedCaracteristic() { + Caracteristic result = driver.getSortedUnsortedCaracteristic(); + Assert.assertNotNull(result); + Assert.assertTrue(result.isQualitativeType()); + Assert.assertNotNull(result.getQualitativeValue()); + Assert.assertEquals(2, result.sizeQualitativeValue()); + } + + @Test + public void getMaturityCaracteristic() { + Caracteristic result = driver.getMaturityCaracteristic(); + Assert.assertNotNull(result); + Assert.assertTrue(result.isQualitativeType()); + Assert.assertNotNull(result.getQualitativeValue()); + Assert.assertEquals(10, result.sizeQualitativeValue()); + } + + @Test + public void getMacroWasteCategoryCaracteristic() { + Caracteristic result = driver.getMacroWasteCategoryCaracteristic(); + Assert.assertNotNull(result); + Assert.assertTrue(result.isQualitativeType()); + Assert.assertNotNull(result.getQualitativeValue()); + Assert.assertEquals(10, result.sizeQualitativeValue()); + } + + @Test + public void getMacroWasteSizeCategoryCaracteristic() { + Caracteristic result = driver.getMacroWasteSizeCategoryCaracteristic(); + Assert.assertNotNull(result); + Assert.assertTrue(result.isQualitativeType()); + Assert.assertNotNull(result.getQualitativeValue()); + Assert.assertEquals(10, result.sizeQualitativeValue()); + } + +} Property changes on: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TestUtil.java 2013-01-09 18:34:01 UTC (rev 161) @@ -30,7 +30,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Assume; -import org.junit.rules.TestName; import org.nuiton.util.ApplicationConfig; import org.nuiton.util.ArgumentsParserException; import org.springframework.context.ApplicationContext; @@ -55,7 +54,7 @@ private static ClassLoader oldClassLoader; public static TuttiPersistenceAdagioConfig createConfig(Class<?> klass, - TestName name) throws ArgumentsParserException, IOException { + String name) throws ArgumentsParserException, IOException { File resourceDirectory = TestUtil.getTestSpecificDirectory(klass, name); @@ -73,7 +72,7 @@ resourceDirectory.getAbsolutePath()); applicationConfig.parse(); - TuttiPersistenceAdagioConfig config = + TuttiPersistenceAdagioConfig config = new TuttiPersistenceAdagioConfig(applicationConfig); config.initConfig(loader); @@ -98,7 +97,7 @@ } public static File getTestSpecificDirectory(Class<?> klass, - TestName name) throws IOException { + String name) throws IOException { // Trying to look for the temporary folder to store data for the test String tempDirPath = System.getProperty("java.io.tmpdir"); if (tempDirPath == null) { @@ -113,7 +112,7 @@ // create the directory to store database data String dataBasePath = klass.getName() + File.separator // a directory with the test class name - + name.getMethodName() // a sub-directory with the method name + + name // a sub-directory with the method name + '_' + BUILD_TIMESTAMP; // and a timestamp File databaseFile = new File(tempDirFile, dataBasePath); Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImplTest.java 2013-01-09 18:34:01 UTC (rev 161) @@ -25,26 +25,24 @@ */ import fr.ifremer.tutti.persistence.config.TuttiPersistenceAdagioConfig; -import fr.ifremer.tutti.persistence.entities.referential.Gear; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.After; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import org.springframework.context.ApplicationContext; -import java.util.List; - /** * To test the {@link TuttiPersistenceAdagioImpl} service. * * @author tchemit <chemit@codelutin.com> * @since 0.3 */ +@Ignore public class TuttiPersistenceAdagioImplTest { /** Logger. */ @@ -67,7 +65,7 @@ @Before public void setUp() throws Exception { - config = TestUtil.createConfig(getClass(), name); + config = TestUtil.createConfig(getClass(), name.getMethodName()); if (log.isDebugEnabled()) { log.debug("Use conf.properties at " + config.getDbConfigurationPath()); @@ -93,11 +91,267 @@ } } + //------------------------------------------------------------------------// + //-- Referential methods --// + //------------------------------------------------------------------------// + + @Test - public void testGetAllGear() throws Exception { + @Ignore + public void getAllProgram() { - List<Gear> allGear = driver.getAllGear(); - Assert.assertNotNull(allGear); - Assert.assertFalse(allGear.isEmpty()); } + + @Test + @Ignore + public void getProgram(/*String id*/) { + + } + + @Test + @Ignore + public void createProgram(/*Program bean*/) { + + } + + @Test + @Ignore + public void saveProgram(/*Program bean*/) { + + } + + @Test + @Ignore + public void getAllCruise(/*String programId*/) { + + } + + @Test + @Ignore + public void getCruise(/*String id*/) { + + } + + @Test + @Ignore + public void createCruise(/*Cruise bean*/) { + + } + + @Test + @Ignore + public void saveCruise(/*Cruise bean*/) { + + } + + @Test + @Ignore + public void getAllProtocol() { + + } + + @Test + @Ignore + public void getProtocol(/*String id*/) { + + } + + @Test + @Ignore + public void createProtocol(/*TuttiProtocol bean*/) { + + } + + @Test + @Ignore + public void saveProtocol(/*TuttiProtocol bean*/) { + + } + + @Test + @Ignore + public void getAllFishingOperation(/*String cruiseId*/) { + + } + + @Test + @Ignore + public void getFishingOperation(/*String id*/) { + + } + + @Test + @Ignore + public void createFishingOperation(/*FishingOperation bean*/) { + + } + + @Test + @Ignore + public void saveFishingOperation(/*FishingOperation bean*/) { + + } + + @Test + @Ignore + public void getAllRootSpeciesBatch(/*String fishingOperationId*/) { + + } + + @Test + @Ignore + public void getAllSpeciesBatch(/*String fishingOperationId*/) { + + } + + @Test + @Ignore + public void getSpeciesBatch(/*String id*/) { + + } + + @Test + @Ignore + public void createSpeciesBatch(/*SpeciesBatch bean, String parentBatchId*/) { + + } + + @Test + @Ignore + public void saveSpeciesBatch(/*SpeciesBatch bean*/) { + + } + + @Test + @Ignore + public void deleteSpeciesBatch(/*String id*/) { + } + + @Test + @Ignore + public void deleteSpeciesSubBatch(/*String id*/) { + } + + @Test + @Ignore + public void getAllSpeciesBatchFrequency(/*String speciesBatchId*/) { + + } + + @Test + @Ignore + public void getAllBenthosBatch(/*String fishingOperationId*/) { + + } + + @Test + @Ignore + public void getBenthosBatch(/*String id*/) { + + } + + @Test + @Ignore + public void createBenthosBatch(/*BenthosBatch bean*/) { + + } + + @Test + @Ignore + public void saveBenthosBatch(/*BenthosBatch bean*/) { + + } + + @Test + @Ignore + public void deleteBenthosBatch(/*String id*/) { + } + + @Test + @Ignore + public void getAllPlanktonBatch(/*String fishingOperationId*/) { + + } + + @Test + @Ignore + public void getPlanktonBatch(/*String id*/) { + + } + + @Test + @Ignore + public void createPlanktonBatch(/*PlanktonBatch bean*/) { + + } + + @Test + @Ignore + public void savePlanktonBatch(/*PlanktonBatch bean*/) { + + } + + @Test + @Ignore + public void deletePlanktonBatch(/*String id*/) { + } + + @Test + @Ignore + public void getAllMacroWasteBatch(/*String fishingOperationId*/) { + + } + + @Test + @Ignore + public void getMacroWasteBatch(/*String id*/) { + + } + + @Test + @Ignore + public void createMacroWasteBatch(/*MacroWasteBatch bean*/) { + + } + + @Test + @Ignore + public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) { + + } + + @Test + @Ignore + public void deleteMacroWasteBatch(/*String id*/) { + } + + @Test + @Ignore + public void getAllAccidentalBatch(/*String fishingOperationId*/) { + + } + + @Test + @Ignore + public void getAccidentalBatch(/*String id*/) { + + } + + @Test + @Ignore + public void createAccidentalBatch(/*AccidentalBatch bean*/) { + + } + + @Test + @Ignore + public void saveAccidentalBatch(/*AccidentalBatch bean*/) { + + } + + @Test + @Ignore + public void deleteAccidentalBatch(/*String id*/) { + } + } Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/VesselDaoTest.java 2013-01-09 18:34:01 UTC (rev 161) @@ -1,54 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $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 org.hibernate.Query; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.List; - -public class VesselDaoTest extends BaseDaoTest { - - @Test - public void getScientificVessel() { - - Query query = getSession().getNamedQuery("getAllScientificVessels"); - - List vessels = query.list(); - Assert.assertNotNull(vessels); - } - - @Ignore - @Test - public void getFishingVessel() { - - Query query = getSession().getNamedQuery("getAllFishingVessels"); - - List vessels = query.list(); - Assert.assertNotNull(vessels); - } -} Modified: trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties =================================================================== --- trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-adagio/src/test/resources/tutti-test.properties 2013-01-09 18:34:01 UTC (rev 161) @@ -21,4 +21,5 @@ # <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### -tutti.persistence.jdbc.url=jdbc:hsqldb:file:src/test/db/allegro \ No newline at end of file +tutti.persistence.jdbc.url=jdbc:hsqldb:file:src/test/db/allegro +#tutti.persistence.jdbc.url=jdbc:hsqldb:hsql://localhost/allegro \ No newline at end of file Added: trunk/tutti-persistence-adagio/src/test/server.properties =================================================================== --- trunk/tutti-persistence-adagio/src/test/server.properties (rev 0) +++ trunk/tutti-persistence-adagio/src/test/server.properties 2013-01-09 18:34:01 UTC (rev 161) @@ -0,0 +1,2 @@ +server.database.0=file:db/allegro +server.dbname.0=allegro \ No newline at end of file Property changes on: trunk/tutti-persistence-adagio/src/test/server.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/test/startServer.sh =================================================================== --- trunk/tutti-persistence-adagio/src/test/startServer.sh (rev 0) +++ trunk/tutti-persistence-adagio/src/test/startServer.sh 2013-01-09 18:34:01 UTC (rev 161) @@ -0,0 +1,3 @@ +#! /bin/sh + +java -classpath ~/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar org.hsqldb.Server --database.0 file:db/allegro --dbname.0 allegro \ No newline at end of file Property changes on: trunk/tutti-persistence-adagio/src/test/startServer.sh ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native 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 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2013-01-09 18:34:01 UTC (rev 161) @@ -206,13 +206,25 @@ } @Override + public List<Species> getAllBenthosSpecies() { + List<Species> result = getDataInNewList(Species.class); + return result; + } + + @Override + public List<Species> getAllPlanktonSpecies() { + List<Species> result = getDataInNewList(Species.class); + return result; + } + + @Override public Species getSpecies(String id) { Species result = getBean(Species.class, id); return result; } @Override - public List<Zone> getAllZone() { + public List<Zone> getAllProgramZone() { List<Zone> result = getDataInNewList(Zone.class); return result; } @@ -224,18 +236,40 @@ } @Override - public List<Vessel> getAllVessel() { - List<Vessel> result = getDataInNewList(Vessel.class); + public List<Vessel> getAllScientificVessel() { + List<Vessel> result = Lists.newArrayList(Iterables.filter(getData(Vessel.class), new Predicate<Vessel>() { + @Override + public boolean apply(Vessel input) { + return input.isScientificVessel(); + } + })); return result; } @Override - public List<Gear> getAllGear() { + public List<Vessel> getAllFishingVessel() { + List<Vessel> result = Lists.newArrayList(Iterables.filter(getData(Vessel.class), new Predicate<Vessel>() { + @Override + public boolean apply(Vessel input) { + return !input.isScientificVessel(); + } + })); + return result; + } + + @Override + public List<Gear> getAllScientificGear() { List<Gear> result = getDataInNewList(Gear.class); return result; } @Override + public List<Gear> getAllFishingGear() { + List<Gear> result = getDataInNewList(Gear.class); + return result; + } + + @Override public List<Person> getAllPerson() { List<Person> result = getDataInNewList(Person.class); 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 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2013-01-09 18:34:01 UTC (rev 161) @@ -136,7 +136,7 @@ Program s = new Program(); s.setId("46de4ba5-3be6-4ab6-9f39-586b8e491fda"); s.setName("Serie 3"); - s.setZone(persistence.getAllZone().get(0)); + s.setZone(persistence.getAllProgramZone().get(0)); persistence.createProgram(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 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-01-09 18:34:01 UTC (rev 161) @@ -173,19 +173,40 @@ //-- Referential methods --// //------------------------------------------------------------------------// + @Override + public List<Vessel> getAllScientificVessel() { + return devDriver.getAllScientificVessel(); + } + + @Override + public List<Vessel> getAllFishingVessel() { + return devDriver.getAllFishingVessel(); + } + + @Override public List<Species> getAllSpecies() { return devDriver.getAllSpecies(); } @Override + public List<Species> getAllBenthosSpecies() { + return devDriver.getAllBenthosSpecies(); + } + + @Override + public List<Species> getAllPlanktonSpecies() { + return devDriver.getAllPlanktonSpecies(); + } + + @Override public Species getSpecies(String speciesId) { return devDriver.getSpecies(speciesId); } @Override - public List<Zone> getAllZone() { - return devDriver.getAllZone(); + public List<Zone> getAllProgramZone() { + return devDriver.getAllProgramZone(); } @Override @@ -194,13 +215,13 @@ } @Override - public List<Vessel> getAllVessel() { - return devDriver.getAllVessel(); + public List<Gear> getAllScientificGear() { + return devDriver.getAllScientificGear(); } @Override - public List<Gear> getAllGear() { - return devDriver.getAllGear(); + public List<Gear> getAllFishingGear() { + return devDriver.getAllFishingGear(); } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-01-09 18:34:01 UTC (rev 161) @@ -24,20 +24,27 @@ * #L% */ +import com.google.common.collect.Lists; import fr.ifremer.tutti.persistence.entities.TuttiEntities; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.Program; +import fr.ifremer.tutti.persistence.entities.referential.Gear; import fr.ifremer.tutti.persistence.entities.referential.Person; +import fr.ifremer.tutti.persistence.entities.referential.Vessel; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import fr.ifremer.tutti.ui.swing.TuttiScreen; import fr.ifremer.tutti.ui.swing.TuttiUIContext; +import jaxx.runtime.JAXXUtil; +import jaxx.runtime.context.JAXXContextEntryDef; import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer; import jaxx.runtime.validator.swing.SwingValidatorUtil; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.util.List; /** @@ -76,6 +83,22 @@ EditCruiseUIModel model = new EditCruiseUIModel(); + // get vessels + + List<Vessel> fishingVessels = persistenceService.getAllFishingVessel(); + FISHING_VESSELS_CONTEXT_ENTRY.setContextValue(ui, fishingVessels); + + List<Vessel> scientificVessels = persistenceService.getAllScientificVessel(); + SCIENTIFIC_VESSELS_CONTEXT_ENTRY.setContextValue(ui, scientificVessels); + + // get gears + + List<Gear> scientificGears = persistenceService.getAllScientificGear(); + SCIENTIFIC_GEARS_CONTEXT_ENTRY.setContextValue(ui, scientificGears); + + List<Gear> fishingGears = persistenceService.getAllFishingGear(); + FISHING_GEARS_CONTEXT_ENTRY.setContextValue(ui, fishingGears); + String cruiseId = context.getCruiseId(); if (cruiseId == null) { @@ -103,6 +126,50 @@ ui.setContextValue(model); } + JAXXContextEntryDef<List<Vessel>> SCIENTIFIC_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + + JAXXContextEntryDef<List<Vessel>> FISHING_VESSELS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + + JAXXContextEntryDef<List<Gear>> SCIENTIFIC_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + + JAXXContextEntryDef<List<Gear>> FISHING_GEARS_CONTEXT_ENTRY = JAXXUtil.newListContextEntryDef(); + + protected List<Vessel> getVesselList(VesselTypeEnum vesselType) { + List<Vessel> result = Lists.newArrayList(); + switch (vesselType) { + + case ALL: + result.addAll(FISHING_VESSELS_CONTEXT_ENTRY.getContextValue(ui)); + result.addAll(SCIENTIFIC_VESSELS_CONTEXT_ENTRY.getContextValue(ui)); + break; + case SCIENTIFIC: + result.addAll(SCIENTIFIC_VESSELS_CONTEXT_ENTRY.getContextValue(ui)); + break; + case FISHING: + result.addAll(FISHING_VESSELS_CONTEXT_ENTRY.getContextValue(ui)); + break; + } + return result; + } + + protected List<Gear> getGearList(VesselTypeEnum vesselType) { + List<Gear> result = Lists.newArrayList(); + switch (vesselType) { + + case ALL: + result.addAll(SCIENTIFIC_GEARS_CONTEXT_ENTRY.getContextValue(ui)); + result.addAll(FISHING_GEARS_CONTEXT_ENTRY.getContextValue(ui)); + break; + case SCIENTIFIC: + result.addAll(SCIENTIFIC_GEARS_CONTEXT_ENTRY.getContextValue(ui)); + break; + case FISHING: + result.addAll(FISHING_GEARS_CONTEXT_ENTRY.getContextValue(ui)); + break; + } + return result; + } + @Override public void afterInitUI() { @@ -112,6 +179,42 @@ EditCruiseUIModel model = getModel(); + // Change vessel list and gear list when vessel type changes + model.addPropertyChangeListener(EditCruiseUIModel.PROPERTY_VESSEL_TYPE, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + + EditCruiseUIModel source = (EditCruiseUIModel) evt.getSource(); + + List<Vessel> selectedVessel = source.getVessel(); + List<Gear> selectedGear = source.getGear(); + + VesselTypeEnum vesselType = (VesselTypeEnum) evt.getNewValue(); + + List<Vessel> newVesselList = getVesselList(vesselType); + List<Gear> newGearList = getGearList(vesselType); + + // compute new selected vessel list + List<Vessel> newSelectedVessel = Lists.newArrayList(selectedVessel); + newSelectedVessel.retainAll(newVesselList); + + // compute new selected gear list + List<Gear> newSelectedGear = Lists.newArrayList(selectedGear); + newSelectedGear.retainAll(newGearList); + + // reinit vessel list + ui.getVesselList().getModel().setUniverse(newVesselList); + ui.getVesselList().getModel().setSelected(newSelectedVessel); + + // reinit gear list + ui.getGearList().getModel().setUniverse(newGearList); + ui.getGearList().getModel().setSelected(newSelectedGear); + + } + }); + + model.setVesselType(VesselTypeEnum.ALL); + initBeanComboBox(ui.getSurveyComboBox(), persistenceService.getAllProgram(), model.getProgram()); @@ -121,11 +224,11 @@ model.getCountry()); initBeanList(ui.getVesselList(), - persistenceService.getAllVessel(), + getVesselList(VesselTypeEnum.ALL), model.getVessel()); initBeanList(ui.getGearList(), - persistenceService.getAllGear(), + getGearList(VesselTypeEnum.ALL), model.getGear()); initBeanList(ui.getHeadOfMissionList(), Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-01-09 18:34:01 UTC (rev 161) @@ -75,6 +75,8 @@ public static final String PROPERTY_CAN_GENERATE_NAME = "canGenerateName"; + public static final String PROPERTY_VESSEL_TYPE = "vesselType"; + protected Program program; protected Country country; @@ -101,6 +103,8 @@ protected Date endDate; + protected VesselTypeEnum vesselType; + protected static Binder<EditCruiseUIModel, Cruise> toBeanBinder = BinderFactory.newBinder(EditCruiseUIModel.class, Cruise.class); @@ -240,6 +244,16 @@ firePropertyChange(PROPERTY_HEAD_OF_SORT_ROOM, null, headOfSortRoom); } + public VesselTypeEnum getVesselType() { + return vesselType; + } + + public void setVesselType(VesselTypeEnum vesselType) { + Object oldValue = getVesselType(); + this.vesselType = vesselType; + firePropertyChange(PROPERTY_VESSEL_TYPE, oldValue, vesselType); + } + public boolean isCanGenerateName() { return program != null && year != null; } Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java 2013-01-09 18:34:01 UTC (rev 161) @@ -0,0 +1,27 @@ +package fr.ifremer.tutti.ui.swing.content.cruise; + +import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; + +/** + * To select which vessel types we can see (All - Scientific, Fishing) + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public enum VesselTypeEnum { + + ALL(n_("tutti.label.vesselType.all")), + SCIENTIFIC(n_("tutti.label.vesselType.scientific")), + FISHING(n_("tutti.label.vesselType.fishing")); + + private final String i18nKey; + + private VesselTypeEnum(String i18nKey) { + this.i18nKey = i18nKey; + } + + public String getLabel() { + return _(i18nKey); + } +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/VesselTypeEnum.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-01-09 18:34:01 UTC (rev 161) @@ -99,7 +99,7 @@ EditProgramUIModel model = getModel(); initBeanComboBox(ui.getZoneComboBox(), - persistenceService.getAllZone(), + persistenceService.getAllProgramZone(), model.getZone()); SwingValidatorUtil.installUI(ui.getErrorTable(), Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-08 22:32:00 UTC (rev 160) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-09 18:34:01 UTC (rev 161) @@ -148,6 +148,9 @@ tutti.label.tab.protocol.species=Espèces tutti.label.tab.species=Espèces tutti.label.traitReminder=Trait \: %s +tutti.label.vesselType.all= +tutti.label.vesselType.fishing= +tutti.label.vesselType.scientific= tutti.legend.catch.benthos=Benthos tutti.legend.catch.macroWaste=Macro déchets tutti.legend.catch.species=Espèces
participants (1)
-
tchemit@users.forge.codelutin.com