r189 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service tutti-persistence-adagio/src/main/resources tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service tutti-persistence
Author: tchemit Date: 2013-01-14 14:22:48 +0100 (Mon, 14 Jan 2013) New Revision: 189 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/189 Log: refs #1809: [Persistence] Adagio Donn?\195?\169es th?\195?\169matiques (create services + tests) Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AbstractPersistenceService.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceTest.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceService.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java Removed: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiEnumerationFile.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml trunk/tutti-persistence-adagio/src/main/resources/beanRefFactory.xml trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 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-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-01-14 13:22:48 UTC (rev 189) @@ -139,6 +139,10 @@ List<Person> getAllPerson(); + Person getPerson(Integer personId); + + Vessel getVessel(String vesselCode); + //------------------------------------------------------------------------// //-- Program methods --// //------------------------------------------------------------------------// Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,24 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; + +import java.util.List; + +/** + * CRUD of {@link AccidentalBatch} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface AccidentalBatchPersistenceService { + + List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId); + + AccidentalBatch getAccidentalBatch(String id); + + AccidentalBatch createAccidentalBatch(AccidentalBatch bean); + + AccidentalBatch saveAccidentalBatch(AccidentalBatch bean); + + void deleteAccidentalBatch(String id); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,24 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; + +import java.util.List; + +/** + * CRUD of {@link BenthosBatch} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface BenthosBatchPersistenceService { + + List<BenthosBatch> getAllBenthosBatch(String fishingOperationId); + + BenthosBatch getBenthosBatch(String id); + + BenthosBatch createBenthosBatch(BenthosBatch bean); + + BenthosBatch saveBenthosBatch(BenthosBatch bean); + + void deleteBenthosBatch(String id); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,22 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.Cruise; + +import java.util.List; + +/** + * CRUD of {@link Cruise} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface CruisePersistenceService { + + List<Cruise> getAllCruise(String programId); + + Cruise getCruise(String id); + + Cruise createCruise(Cruise bean); + + Cruise saveCruise(Cruise bean); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,22 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.FishingOperation; + +import java.util.List; + +/** + * CRUD of {@link FishingOperation} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface FishingOperationPersistenceService { + + List<FishingOperation> getAllFishingOperation(String cruiseId); + + FishingOperation getFishingOperation(String id); + + FishingOperation createFishingOperation(FishingOperation bean); + + FishingOperation saveFishingOperation(FishingOperation bean); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,25 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; + +import java.util.List; + +/** + * CRUD of {@link MacroWasteBatch} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface MacroWasteBatchPersistenceService { + + + List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId); + + MacroWasteBatch getMacroWasteBatch(String id); + + MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean); + + MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean); + + void deleteMacroWasteBatch(String id); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,24 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch; + +import java.util.List; + +/** + * CRUD of {@link PlanktonBatch} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface PlanktonBatchPersistenceService { + + List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId); + + PlanktonBatch getPlanktonBatch(String id); + + PlanktonBatch createPlanktonBatch(PlanktonBatch bean); + + PlanktonBatch savePlanktonBatch(PlanktonBatch bean); + + void deletePlanktonBatch(String id); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,22 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.Program; + +import java.util.List; + +/** + * CRUD of {@link Program} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface ProgramPersistenceService { + + List<Program> getAllProgram(); + + Program getProgram(String id); + + Program createProgram(Program bean); + + Program saveProgram(Program bean); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,22 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; + +import java.util.List; + +/** + * CRUD of {@link TuttiProtocol} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface ProtocolPersistenceService { + + List<TuttiProtocol> getAllProtocol(); + + TuttiProtocol getProtocol(String id); + + TuttiProtocol createProtocol(TuttiProtocol bean); + + TuttiProtocol saveProtocol(TuttiProtocol bean); +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java (rev 0) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,37 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; + +import java.util.List; + +/** + * CRUD of {@link SpeciesBatch} entity. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public interface SpeciesBatchPersistenceService { + + + List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId); + + List<SpeciesBatch> getAllSpeciesBatch(String fishingOperationId); + + SpeciesBatch getSpeciesBatch(String id); + + SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentBatchId); + + SpeciesBatch saveSpeciesBatch(SpeciesBatch bean); + + void deleteSpeciesBatch(String id); + + void deleteSpeciesSubBatch(String id); + + List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency( + String speciesBatchId); + + List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, + List<SpeciesBatchFrequency> frequencies); + +} Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiEnumerationFile.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiEnumerationFile.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiEnumerationFile.java 2013-01-14 13:22:48 UTC (rev 189) @@ -28,7 +28,7 @@ import org.springframework.beans.factory.annotation.Value; /** - * Contains all constants usablevia the enumeration file. + * Contains all constants usable via the enumeration file. * * @author tchemit <chemit@codelutin.com> * @since 0.3 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-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -24,18 +24,6 @@ * #L% */ -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao; -import fr.ifremer.adagio.core.dao.administration.user.PersonDao; -import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.FishingTrip; -import fr.ifremer.adagio.core.dao.data.survey.scientificCruise.ScientificCruise; -import fr.ifremer.adagio.core.dao.data.survey.scientificCruise.ScientificCruiseDao; -import fr.ifremer.adagio.core.dao.referential.QualityFlagDao; -import fr.ifremer.adagio.core.dao.referential.location.Location; -import fr.ifremer.adagio.core.dao.referential.location.LocationDao; -import fr.ifremer.adagio.core.dao.referential.vessel.VesselDao; -import fr.ifremer.adagio.core.dao.technical.synchronization.SynchronizationStatus; import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; @@ -54,24 +42,23 @@ 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 fr.ifremer.tutti.persistence.service.AccidentalBatchPersistenceService; +import fr.ifremer.tutti.persistence.service.BenthosBatchPersistenceService; +import fr.ifremer.tutti.persistence.service.CruisePersistenceService; +import fr.ifremer.tutti.persistence.service.FishingOperationPersistenceService; +import fr.ifremer.tutti.persistence.service.MacroWasteBatchPersistenceService; +import fr.ifremer.tutti.persistence.service.PlanktonBatchPersistenceService; +import fr.ifremer.tutti.persistence.service.ProgramPersistenceService; +import fr.ifremer.tutti.persistence.service.ProtocolPersistenceService; import fr.ifremer.tutti.persistence.service.ReferentialPersistenceService; +import fr.ifremer.tutti.persistence.service.SpeciesBatchPersistenceService; import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hibernate.Query; -import org.hibernate.SessionFactory; -import org.hibernate.type.IntegerType; -import org.hibernate.type.StringType; -import org.hibernate.type.Type; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import java.io.IOException; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.Iterator; import java.util.List; /** @@ -85,44 +72,37 @@ private static final Log log = LogFactory.getLog(TuttiPersistenceAdagioImpl.class); - /** - * Session factory. - * - * @since 0.3 - */ @Autowired(required = true) - protected SessionFactory sessionFactory; + protected ReferentialPersistenceService referentielService; - @Resource(name = "programDao") - protected ProgramDao programDao; + @Autowired(required = true) + protected ProgramPersistenceService programService; - @Resource(name = "scientificCruiseDao") - protected ScientificCruiseDao scientificCruiseDao; - @Resource(name = "personDao") - protected PersonDao personDao; - - @Resource(name = "vesselDao") - protected VesselDao vesselDao; - - @Resource(name = "locationDao") - protected LocationDao locationDao; + @Autowired(required = true) + protected CruisePersistenceService cruiseService; - @Resource(name = "qualityFlagDao") - protected QualityFlagDao qualityFlagDao; - - protected Calendar calendar = new GregorianCalendar(); - - protected static String CRUISE_MISC_DATA_VESSELS_TAG="#VESSELS="; - - protected static String CRUISE_MISC_DATA_GEARS_TAG="#GEARS="; + @Autowired(required = true) + protected FishingOperationPersistenceService fishingOperationService; @Autowired(required = true) - protected ReferentialPersistenceService referentielService; + protected SpeciesBatchPersistenceService speciesBatchService; @Autowired(required = true) - protected TuttiEnumerationFile enumeration; + protected BenthosBatchPersistenceService benthosBatchService; + @Autowired(required = true) + protected PlanktonBatchPersistenceService planktonBatchService; + + @Autowired(required = true) + protected MacroWasteBatchPersistenceService macroWasteBatchService; + + @Autowired(required = true) + protected AccidentalBatchPersistenceService accidentalBatchService; + + @Autowired(required = true) + protected ProtocolPersistenceService protocolService; + @Override public String getImplementationName() { return "Persistence Adagio implementation"; @@ -268,64 +248,38 @@ return referentielService.getAllPerson(); } + @Override + public Vessel getVessel(String vesselCode) { + return referentielService.getVessel(vesselCode); + } + + @Override + public Person getPerson(Integer personId) { + return referentielService.getPerson(personId); + } + //------------------------------------------------------------------------// //-- Program methods --// //------------------------------------------------------------------------// @Override public List<Program> getAllProgram() { - Iterator<Object[]> list = queryList("allPrograms"); - - List<Program> result = Lists.newArrayList(); - while (list.hasNext()) { - Object[] source = list.next(); - Program target = new Program(); - target.setId((String) source[0]); - target.setName((String) source[1]); - result.add(target); - } - return result; + return programService.getAllProgram(); } @Override public Program getProgram(String id) { - Object[] source = queryUnique( - "program", - "programCode", StringType.INSTANCE, id); - - Program result = new Program(); - result.setId((String) source[0]); - result.setName((String) source[1]); - - // get program locations - Iterator<Object[]> list = queryList( - "allProgramLocations", - "programCode", StringType.INSTANCE, id); - - List<Zone> zones = Lists.newArrayList(); - while (list.hasNext()) { - Object[] zoneSource = list.next(); - Zone target = new Zone(); - target.setId(String.valueOf(zoneSource[0])); - target.setLabel((String) zoneSource[1]); - target.setName((String) zoneSource[2]); - zones.add(target); - } - if (!zones.isEmpty()) { - result.setZone(zones.get(0)); - } - - return result; + return programService.getProgram(id); } @Override public Program createProgram(Program bean) { - throw new UnsupportedOperationException(); + return programService.createProgram(bean); } @Override public Program saveProgram(Program bean) { - throw new UnsupportedOperationException(); + return programService.saveProgram(bean); } //------------------------------------------------------------------------// @@ -334,252 +288,22 @@ @Override public List<Cruise> getAllCruise(String programId) { - Iterator<Object[]> list = queryList( - "allCruises", - "programCode", StringType.INSTANCE, programId); - - List<Cruise> result = Lists.newArrayList(); - while (list.hasNext()) { - Object[] source = list.next(); - Cruise target = new Cruise(); - target.setId((String) source[0]); - target.setName((String) source[1]); - target.setBeginDate((Date) source[2]); - result.add(target); - } - return result; + return cruiseService.getAllCruise(programId); } @Override public Cruise getCruise(String id) { - Object[] source = queryUnique( - "cruise", - "cruiseId", StringType.INSTANCE, id, - "locationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_LOCALITE); - - Cruise result = new Cruise(); - result.setId(id); - - String programCode = (String) source[0]; - Program program = getProgram(programCode); - result.setProgram(program); - - result.setYear((Integer) source[1]); - result.setName((String) source[2]); - - String countryId = String.valueOf(source[3]); - String countryLabel = (String) source[4]; - String countryName = (String) source[5]; - Country c = new Country(); - c.setId(countryId); - c.setName(countryName); - c.setLabel(countryLabel); - result.setCountry(c); - - result.setBeginDate((Date) source[6]); - result.setEndDate((Date) source[7]); - - String vesselCode = (String) source[8]; - Vessel vessel = referentielService.getVessel(vesselCode); - result.setVessel(Lists.newArrayList(vessel)); - - Integer managerId = (Integer) source[9]; - Person manager = referentielService.getPerson(managerId); - result.setHeadOfMission(Lists.newArrayList(manager)); - - result.setComment((String) source[10]); - - // get secondary gears - Iterator<Object[]> list = queryList( - "allCruiseSecondaryGears", - "cruiseId", StringType.INSTANCE, id); - - List<Gear> gears = Lists.newArrayList(); - while (list.hasNext()) { - Object[] zoneSource = list.next(); - Gear target = new Gear(); - target.setId((String) zoneSource[0]); - target.setLabel((String) zoneSource[1]); - target.setName((String) zoneSource[2]); - gears.add(target); - } - result.setGear(gears); - return result; + return cruiseService.getCruise(id); } @Override public Cruise createCruise(Cruise bean) { - ScientificCruise scientificCruise = ScientificCruise.Factory.newInstance(); - cruiseToEntity(bean, scientificCruise, true); - scientificCruiseDao.create(scientificCruise); - - bean.setId(String.valueOf(scientificCruise.getId())); - return bean; + return cruiseService.createCruise(bean); } - - protected void cruiseToEntity(Cruise source, ScientificCruise target, boolean copyIfNull) { - StringBuffer miscDataBuffer = new StringBuffer(); - - // Name - if (copyIfNull && source.getName() == null) { - target.setName(null); - } else if (source.getName() != null) { - target.setName(source.getName()); - } - - // Program - if (copyIfNull && (source.getProgram() == null || source.getProgram().getId() == null)) { - target.setProgram(null); - } else if (source.getName() != null && source.getProgram().getId() != null) { - target.setProgram(programDao.load(source.getProgram().getId())); - } - - // Vessel - if (copyIfNull && (source.getVessel() == null || source.getVessel().size() == 0)) { - target.setProgram(null); - } else if (source.getVessel() != null && source.getVessel().size() > 0) { - List<Vessel> vessels = source.getVessel(); - target.setVessel(vesselDao.load(vessels.get(0).getId())); - - if (vessels.size() > 1) { - //throw new UnsupportedOperationException("Cruise could not yet support more than one vessel."); - miscDataBuffer.append(CRUISE_MISC_DATA_VESSELS_TAG); - for(int i=1; i<vessels.size(); i++) { - if (i>1) miscDataBuffer.append(','); - miscDataBuffer.append(vessels.get(i).getId()); - } - } - } - - // Year - if (copyIfNull && source.getYear() == null && source.getBeginDate() == null) { - target.setDepartureDateTime(null); - } - else if (source.getYear() != null && source.getBeginDate() == null) { - // Set year into departure date time only if no departure date time has been set - calendar.setTimeInMillis(0); - calendar.set(Calendar.YEAR, source.getYear()); - // Add one millisecond to retrieve a 'year saved but no departure date' - calendar.set(Calendar.MILLISECOND, 1); - target.setDepartureDateTime(calendar.getTime()); - } - - // BeginDate - if (copyIfNull && source.getYear() == null && source.getBeginDate() == null) { - target.setDepartureDateTime(null); - } else if (source.getBeginDate() != null) { - target.setDepartureDateTime(source.getBeginDate()); - } - - // EndDate - if (copyIfNull && source.getEndDate() == null) { - target.setReturnDateTime(null); - } else if (source.getEndDate() != null) { - target.setReturnDateTime(source.getEndDate()); - } - - // Comment - if (copyIfNull && source.getComment() == null) { - target.setComments(null); - } else if (source.getComment() != null) { - target.setComments(source.getComment()); - } - - // Manager - if (copyIfNull && (source.getHeadOfMission() == null || source.getHeadOfMission().size() == 0)) { - target.setComments(null); - } else if (source.getHeadOfMission() != null && source.getHeadOfMission().size() > 0) { - if (source.getHeadOfMission().size() == 1) { - Person managerPerson = source.getHeadOfMission().get(0); - if (managerPerson.getId() != null) { - target.setManagerPerson(personDao.load(Integer.valueOf(managerPerson.getId()))); - } - } - else { - // TODO : comment gérer dans le modèle Adagio plus d'un manager ? - throw new UnsupportedOperationException("Cruise could not yet support more than one manager person."); - } - } - - // Optional values in UI, but mandatory in DB - if (target.getManagerPerson() == null) { - target.setManagerPerson(personDao.load(enumeration.PERSON_ID_UNKNOWN_RECORDER_PERSON)); - } - - // Default values : - target.setSynchronizationStatus(SynchronizationStatus.DIRTY.getValue()); - if (target.getCreationDate() == null) { - target.setCreationDate(new Date()); - } - if (target.getManagerPerson() != null) { - target.setRecorderPerson(target.getManagerPerson()); - target.setRecorderDepartment(target.getManagerPerson().getDepartment()); - } - - // FishingTrip - FishingTrip fishingTrip = null; - if (target.getFishingTrips() == null || target.getFishingTrips().size() == 0) { - fishingTrip = FishingTrip.Factory.newInstance(); - if (target.getFishingTrips() == null) { - target.setFishingTrips(Lists.newArrayList(fishingTrip)); - fishingTrip.setScientificCruise(target); - } - else { - target.getFishingTrips().add(fishingTrip); - fishingTrip.setScientificCruise(target); - } - } - - // Fill fishing trip with scientificCruise info: - fishingTrip.setDepartureDateTime(target.getDepartureDateTime()); - fishingTrip.setReturnDateTime(target.getReturnDateTime()); - fishingTrip.setVessel(target.getVessel()); - fishingTrip.setProgram(target.getProgram()); - fishingTrip.setRecorderPerson(target.getRecorderPerson()); - fishingTrip.setRecorderDepartment(target.getRecorderDepartment()); - fishingTrip.setCreationDate(target.getCreationDate()); - fishingTrip.setSynchronizationStatus(target.getSynchronizationStatus()); - if (fishingTrip.getQualityFlag() == null) { - fishingTrip.setQualityFlag(qualityFlagDao.load(enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED)); - } - - if (fishingTrip.getReturnDateTime() == null && fishingTrip.getDepartureDateTime() != null) { - calendar.setTime(fishingTrip.getDepartureDateTime()); - calendar.add(Calendar.MILLISECOND, 1); // = departureDateTime + 1ms - fishingTrip.setReturnDateTime(calendar.getTime()); - } - - // Country - if (copyIfNull && source.getCountry() == null || source.getCountry().getId() == null) { - fishingTrip.setDepartureLocation(null); - fishingTrip.setReturnLocation(null); - } else if (source.getCountry() != null && source.getCountry().getId() != null) { - Location locationCountry = locationDao.load(Integer.valueOf(source.getCountry().getId())); - fishingTrip.setDepartureLocation(locationCountry); - fishingTrip.setReturnLocation(locationCountry); - } - - // Gear - if (copyIfNull && source.isGearEmpty()) { - miscDataBuffer.append(CRUISE_MISC_DATA_GEARS_TAG); - } else if (!source.isGearEmpty()) { - //throw new UnsupportedOperationException("Cruise could not yet support gears storage."); - miscDataBuffer.append(CRUISE_MISC_DATA_GEARS_TAG); - for(int i=0; i<source.getGear().size(); i++) { - if (i>0) miscDataBuffer.append(','); - miscDataBuffer.append(source.getGear().get(i).getId()); - } - } - - // Save miscDataBuffer into comments - // TODO BLA : vérifier que les UI Allegro n'utilise pas ce commentaires, - // mais bien celui de scientificCruise - fishingTrip.setComments(miscDataBuffer.toString()); - } @Override public Cruise saveCruise(Cruise bean) { - throw new UnsupportedOperationException(); + return cruiseService.saveCruise(bean); } //------------------------------------------------------------------------// @@ -588,98 +312,96 @@ @Override public List<TuttiProtocol> getAllProtocol() { - throw new UnsupportedOperationException(); + return protocolService.getAllProtocol(); } @Override - public TuttiProtocol getProtocol(String id) { - throw new UnsupportedOperationException(); + public TuttiProtocol saveProtocol(TuttiProtocol bean) { + return protocolService.saveProtocol(bean); } @Override public TuttiProtocol createProtocol(TuttiProtocol bean) { - throw new UnsupportedOperationException(); + return protocolService.createProtocol(bean); } @Override - public TuttiProtocol saveProtocol(TuttiProtocol bean) { - throw new UnsupportedOperationException(); + public TuttiProtocol getProtocol(String id) { + return protocolService.getProtocol(id); } + //------------------------------------------------------------------------// //-- Fishing operation methods --// //------------------------------------------------------------------------// @Override public List<FishingOperation> getAllFishingOperation(String cruiseId) { - throw new UnsupportedOperationException(); + return fishingOperationService.getAllFishingOperation(cruiseId); } @Override public FishingOperation getFishingOperation(String id) { - throw new UnsupportedOperationException(); + return fishingOperationService.getFishingOperation(id); } @Override public FishingOperation createFishingOperation(FishingOperation bean) { - throw new UnsupportedOperationException(); + return fishingOperationService.createFishingOperation(bean); } @Override public FishingOperation saveFishingOperation(FishingOperation bean) { - throw new UnsupportedOperationException(); + return fishingOperationService.saveFishingOperation(bean); } //------------------------------------------------------------------------// //-- Species Batch methods --// //------------------------------------------------------------------------// - @Override public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) { - throw new UnsupportedOperationException(); + return speciesBatchService.getAllRootSpeciesBatch(fishingOperationId); } @Override public List<SpeciesBatch> getAllSpeciesBatch(String fishingOperationId) { - throw new UnsupportedOperationException(); + return speciesBatchService.getAllSpeciesBatch(fishingOperationId); } @Override public SpeciesBatch getSpeciesBatch(String id) { - throw new UnsupportedOperationException(); + return speciesBatchService.getSpeciesBatch(id); } @Override - public SpeciesBatch createSpeciesBatch(SpeciesBatch bean, - String parentBatchId) { - throw new UnsupportedOperationException(); + public SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentBatchId) { + return speciesBatchService.createSpeciesBatch(bean, parentBatchId); } @Override public SpeciesBatch saveSpeciesBatch(SpeciesBatch bean) { - throw new UnsupportedOperationException(); + return speciesBatchService.saveSpeciesBatch(bean); } @Override public void deleteSpeciesBatch(String id) { - throw new UnsupportedOperationException(); + speciesBatchService.deleteSpeciesBatch(id); } @Override public void deleteSpeciesSubBatch(String id) { - throw new UnsupportedOperationException(); + speciesBatchService.deleteSpeciesSubBatch(id); } @Override public List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency(String speciesBatchId) { - throw new UnsupportedOperationException(); + return speciesBatchService.getAllSpeciesBatchFrequency(speciesBatchId); } @Override - public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, - List<SpeciesBatchFrequency> frequencies) { - throw new UnsupportedOperationException(); + public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, List<SpeciesBatchFrequency> frequencies) { + return speciesBatchService.saveSpeciesBatchFrequency(speciesBatchId, frequencies); } //------------------------------------------------------------------------// @@ -688,27 +410,27 @@ @Override public List<BenthosBatch> getAllBenthosBatch(String fishingOperationId) { - throw new UnsupportedOperationException(); + return benthosBatchService.getAllBenthosBatch(fishingOperationId); } @Override public BenthosBatch getBenthosBatch(String id) { - throw new UnsupportedOperationException(); + return benthosBatchService.getBenthosBatch(id); } @Override public BenthosBatch createBenthosBatch(BenthosBatch bean) { - throw new UnsupportedOperationException(); + return benthosBatchService.createBenthosBatch(bean); } @Override public BenthosBatch saveBenthosBatch(BenthosBatch bean) { - throw new UnsupportedOperationException(); + return benthosBatchService.saveBenthosBatch(bean); } @Override public void deleteBenthosBatch(String id) { - throw new UnsupportedOperationException(); + benthosBatchService.deleteBenthosBatch(id); } //------------------------------------------------------------------------// @@ -717,27 +439,27 @@ @Override public List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId) { - throw new UnsupportedOperationException(); + return planktonBatchService.getAllPlanktonBatch(fishingOperationId); } @Override public PlanktonBatch getPlanktonBatch(String id) { - throw new UnsupportedOperationException(); + return planktonBatchService.getPlanktonBatch(id); } @Override public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) { - throw new UnsupportedOperationException(); + return planktonBatchService.createPlanktonBatch(bean); } @Override public PlanktonBatch savePlanktonBatch(PlanktonBatch bean) { - throw new UnsupportedOperationException(); + return planktonBatchService.savePlanktonBatch(bean); } @Override public void deletePlanktonBatch(String id) { - throw new UnsupportedOperationException(); + planktonBatchService.deletePlanktonBatch(id); } //------------------------------------------------------------------------// @@ -746,27 +468,27 @@ @Override public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) { - throw new UnsupportedOperationException(); + return macroWasteBatchService.getAllMacroWasteBatch(fishingOperationId); } @Override public MacroWasteBatch getMacroWasteBatch(String id) { - throw new UnsupportedOperationException(); + return macroWasteBatchService.getMacroWasteBatch(id); } @Override public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) { - throw new UnsupportedOperationException(); + return macroWasteBatchService.createMacroWasteBatch(bean); } @Override public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) { - throw new UnsupportedOperationException(); + return macroWasteBatchService.saveMacroWasteBatch(bean); } @Override public void deleteMacroWasteBatch(String id) { - throw new UnsupportedOperationException(); + macroWasteBatchService.deleteMacroWasteBatch(id); } //------------------------------------------------------------------------// @@ -775,85 +497,32 @@ @Override public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) { - throw new UnsupportedOperationException(); + return accidentalBatchService.getAllAccidentalBatch(fishingOperationId); } @Override public AccidentalBatch getAccidentalBatch(String id) { - throw new UnsupportedOperationException(); + return accidentalBatchService.getAccidentalBatch(id); } @Override public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) { - throw new UnsupportedOperationException(); + return accidentalBatchService.createAccidentalBatch(bean); } @Override public AccidentalBatch saveAccidentalBatch(AccidentalBatch bean) { - throw new UnsupportedOperationException(); + return accidentalBatchService.saveAccidentalBatch(bean); } @Override public void deleteAccidentalBatch(String id) { - throw new UnsupportedOperationException(); + accidentalBatchService.deleteAccidentalBatch(id); } //------------------------------------------------------------------------// //-- Internal methods --// //------------------------------------------------------------------------// - 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; - } - } Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AbstractPersistenceService.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AbstractPersistenceService.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AbstractPersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,90 @@ +package fr.ifremer.tutti.persistence.service; + +import com.google.common.base.Preconditions; +import fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao; +import fr.ifremer.tutti.persistence.TuttiEnumerationFile; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.classic.Session; +import org.hibernate.type.Type; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; +import java.util.Iterator; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public abstract class AbstractPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(AbstractPersistenceService.class); + + /** + * Session factory. + * + * @since 0.3 + */ + @Autowired(required = true) + protected SessionFactory sessionFactory; + + @Autowired(required = true) + protected TuttiEnumerationFile enumeration; + + @Resource(name = "programDao") + protected ProgramDao programDao; + + protected final SessionFactory getSessionFactory() { + return sessionFactory; + } + + protected final Session getCurrentSession() { + return getSessionFactory().getCurrentSession(); + } + + protected Object[] queryUnique(String queryName, Object... params) { + + Query query = createQuery(queryName, params); + Object result = query.uniqueResult(); + return (Object[]) result; + } + + protected Iterator<Object[]> queryList(String queryName, Object... params) { + + Query query = createQuery(queryName, params); + + Iterator result = query.iterate(); + return result; + } + + protected Query createQuery(String queryName, Object... params) { + Query query = 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 + "])"); + } + } + } + return query; + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AbstractPersistenceService.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,46 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("accidentalBatchPersistenceService") +@Transactional(readOnly = true) +public class AccidentalBatchPersistenceServiceImpl extends AbstractPersistenceService implements AccidentalBatchPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(AccidentalBatchPersistenceServiceImpl.class); + + @Override + public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) { + return null; + } + + @Override + public AccidentalBatch getAccidentalBatch(String id) { + return null; + } + + @Override + public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) { + return null; + } + + @Override + public AccidentalBatch saveAccidentalBatch(AccidentalBatch bean) { + return null; + } + + @Override + public void deleteAccidentalBatch(String id) { + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,46 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("benthosBatchPersistenceService") +@Transactional(readOnly = true) +public class BenthosBatchPersistenceServiceImpl extends AbstractPersistenceService implements BenthosBatchPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(BenthosBatchPersistenceServiceImpl.class); + + @Override + public List<BenthosBatch> getAllBenthosBatch(String fishingOperationId) { + return null; + } + + @Override + public BenthosBatch getBenthosBatch(String id) { + return null; + } + + @Override + public BenthosBatch createBenthosBatch(BenthosBatch bean) { + return null; + } + + @Override + public BenthosBatch saveBenthosBatch(BenthosBatch bean) { + return null; + } + + @Override + public void deleteBenthosBatch(String id) { + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,337 @@ +package fr.ifremer.tutti.persistence.service; + +import com.google.common.collect.Lists; +import fr.ifremer.adagio.core.dao.administration.user.PersonDao; +import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.FishingTrip; +import fr.ifremer.adagio.core.dao.data.survey.scientificCruise.ScientificCruise; +import fr.ifremer.adagio.core.dao.data.survey.scientificCruise.ScientificCruiseDao; +import fr.ifremer.adagio.core.dao.referential.QualityFlagDao; +import fr.ifremer.adagio.core.dao.referential.location.Location; +import fr.ifremer.adagio.core.dao.referential.location.LocationDao; +import fr.ifremer.adagio.core.dao.referential.vessel.VesselDao; +import fr.ifremer.adagio.core.dao.technical.synchronization.SynchronizationStatus; +import fr.ifremer.tutti.persistence.entities.data.Cruise; +import fr.ifremer.tutti.persistence.entities.data.Program; +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.Vessel; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hibernate.type.IntegerType; +import org.hibernate.type.StringType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Iterator; +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("cruisePersistenceService") +@Transactional(readOnly = true) +public class CruisePersistenceServiceImpl extends AbstractPersistenceService implements CruisePersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(CruisePersistenceServiceImpl.class); + + protected static String CRUISE_MISC_DATA_VESSELS_TAG = "#VESSELS="; + + protected static String CRUISE_MISC_DATA_GEARS_TAG = "#GEARS="; + + @Autowired(required = true) + protected ReferentialPersistenceService referentielService; + + @Autowired(required = true) + protected ProgramPersistenceService programService; + + @Resource(name = "scientificCruiseDao") + protected ScientificCruiseDao scientificCruiseDao; + + @Resource(name = "personDao") + protected PersonDao personDao; + + @Resource(name = "vesselDao") + protected VesselDao vesselDao; + + @Resource(name = "locationDao") + protected LocationDao locationDao; + + @Resource(name = "qualityFlagDao") + protected QualityFlagDao qualityFlagDao; + + protected Calendar calendar = new GregorianCalendar(); + + @Override + public List<Cruise> getAllCruise(String programId) { + Iterator<Object[]> list = queryList( + "allCruises", + "programCode", StringType.INSTANCE, programId); + + List<Cruise> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Cruise target = new Cruise(); + target.setId(String.valueOf(source[0])); + target.setName((String) source[1]); + target.setBeginDate((Date) source[2]); + result.add(target); + } + return result; + } + + @Override + public Cruise getCruise(String id) { + Object[] source = queryUnique( + "cruise", + "cruiseId", IntegerType.INSTANCE, Integer.valueOf(id), + "countryLocationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_COUNTRY); + + Cruise result = new Cruise(); + result.setId(id); + + String programCode = (String) source[0]; + Program program = programService.getProgram(programCode); + result.setProgram(program); + + result.setYear((Integer) source[1]); + result.setName((String) source[2]); + + String countryId = String.valueOf(source[3]); + String countryLabel = (String) source[4]; + String countryName = (String) source[5]; + Country c = new Country(); + c.setId(countryId); + c.setName(countryName); + c.setLabel(countryLabel); + result.setCountry(c); + + result.setBeginDate((Date) source[6]); + result.setEndDate((Date) source[7]); + + List<Vessel> vessels = Lists.newArrayList(); + + String vesselCode = (String) source[8]; + Vessel vessel = referentielService.getVessel(vesselCode); + vessels.add(vessel); + + Integer managerId = (Integer) source[9]; + Person manager = referentielService.getPerson(managerId); + result.setHeadOfMission(Lists.newArrayList(manager)); + + result.setComment((String) source[10]); + + // get gears + Iterator<Object[]> list = queryList( + "allCruiseGears", + "cruiseId", IntegerType.INSTANCE, Integer.valueOf(id)); + + List<Gear> gears = Lists.newArrayList(); + while (list.hasNext()) { + Object[] zoneSource = list.next(); + Gear target = new Gear(); + target.setId((String) zoneSource[0]); + target.setLabel((String) zoneSource[1]); + target.setName((String) zoneSource[2]); + gears.add(target); + } + + // get secondary vessels + list = queryList( + "allCruiseSecondaryVessels", + "cruiseId", IntegerType.INSTANCE, Integer.valueOf(id)); + + while (list.hasNext()) { + Object[] zoneSource = list.next(); + vesselCode = (String) zoneSource[0]; + vessel = referentielService.getVessel(vesselCode); + vessels.add(vessel); + } + + result.setVessel(vessels); + return result; + } + + @Transactional(readOnly = false) + @Override + public Cruise createCruise(Cruise bean) { + ScientificCruise scientificCruise = ScientificCruise.Factory.newInstance(); + cruiseToEntity(bean, scientificCruise, true); + scientificCruiseDao.create(scientificCruise); + + bean.setId(String.valueOf(scientificCruise.getId())); + return bean; + } + + @Transactional(readOnly = false) + @Override + public Cruise saveCruise(Cruise bean) { + throw new UnsupportedOperationException(); + } + + protected void cruiseToEntity(Cruise source, ScientificCruise target, boolean copyIfNull) { + StringBuffer miscDataBuffer = new StringBuffer(); + + // Name + if (copyIfNull && source.getName() == null) { + target.setName(null); + } else if (source.getName() != null) { + target.setName(source.getName()); + } + + // Program + if (copyIfNull && (source.getProgram() == null || source.getProgram().getId() == null)) { + target.setProgram(null); + } else if (source.getName() != null && source.getProgram().getId() != null) { + target.setProgram(programDao.load(source.getProgram().getId())); + } + + // Vessel + if (copyIfNull && (source.getVessel() == null || source.getVessel().size() == 0)) { + target.setProgram(null); + } else if (source.getVessel() != null && source.getVessel().size() > 0) { + List<Vessel> vessels = source.getVessel(); + target.setVessel(vesselDao.load(vessels.get(0).getId())); + + if (vessels.size() > 1) { + //throw new UnsupportedOperationException("Cruise could not yet support more than one vessel."); + miscDataBuffer.append(CRUISE_MISC_DATA_VESSELS_TAG); + for (int i = 1; i < vessels.size(); i++) { + if (i > 1) miscDataBuffer.append(','); + miscDataBuffer.append(vessels.get(i).getId()); + } + } + } + + // Year + if (copyIfNull && source.getYear() == null && source.getBeginDate() == null) { + target.setDepartureDateTime(null); + } else if (source.getYear() != null && source.getBeginDate() == null) { + // Set year into departure date time only if no departure date time has been set + calendar.setTimeInMillis(0); + calendar.set(Calendar.YEAR, source.getYear()); + // Add one millisecond to retrieve a 'year saved but no departure date' + calendar.set(Calendar.MILLISECOND, 1); + target.setDepartureDateTime(calendar.getTime()); + } + + // BeginDate + if (copyIfNull && source.getYear() == null && source.getBeginDate() == null) { + target.setDepartureDateTime(null); + } else if (source.getBeginDate() != null) { + target.setDepartureDateTime(source.getBeginDate()); + } + + // EndDate + if (copyIfNull && source.getEndDate() == null) { + target.setReturnDateTime(null); + } else if (source.getEndDate() != null) { + target.setReturnDateTime(source.getEndDate()); + } + + // Comment + if (copyIfNull && source.getComment() == null) { + target.setComments(null); + } else if (source.getComment() != null) { + target.setComments(source.getComment()); + } + + // Manager + if (copyIfNull && (source.getHeadOfMission() == null || source.getHeadOfMission().size() == 0)) { + target.setComments(null); + } else if (source.getHeadOfMission() != null && source.getHeadOfMission().size() > 0) { + if (source.getHeadOfMission().size() == 1) { + Person managerPerson = source.getHeadOfMission().get(0); + if (managerPerson.getId() != null) { + target.setManagerPerson(personDao.load(Integer.valueOf(managerPerson.getId()))); + } + } else { + // TODO : comment gérer dans le modèle Adagio plus d'un manager ? + throw new UnsupportedOperationException("Cruise could not yet support more than one manager person."); + } + } + + // Optional values in UI, but mandatory in DB + if (target.getManagerPerson() == null) { + target.setManagerPerson(personDao.load(enumeration.PERSON_ID_UNKNOWN_RECORDER_PERSON)); + } + + // Default values : + target.setSynchronizationStatus(SynchronizationStatus.DIRTY.getValue()); + if (target.getCreationDate() == null) { + target.setCreationDate(new Date()); + } + if (target.getManagerPerson() != null) { + target.setRecorderPerson(target.getManagerPerson()); + target.setRecorderDepartment(target.getManagerPerson().getDepartment()); + } + + // FishingTrip + FishingTrip fishingTrip = null; + if (target.getFishingTrips() == null || target.getFishingTrips().size() == 0) { + fishingTrip = FishingTrip.Factory.newInstance(); + if (target.getFishingTrips() == null) { + target.setFishingTrips(Lists.newArrayList(fishingTrip)); + fishingTrip.setScientificCruise(target); + } else { + target.getFishingTrips().add(fishingTrip); + fishingTrip.setScientificCruise(target); + } + } + + // Fill fishing trip with scientificCruise info: + fishingTrip.setDepartureDateTime(target.getDepartureDateTime()); + fishingTrip.setReturnDateTime(target.getReturnDateTime()); + fishingTrip.setVessel(target.getVessel()); + fishingTrip.setProgram(target.getProgram()); + fishingTrip.setRecorderPerson(target.getRecorderPerson()); + fishingTrip.setRecorderDepartment(target.getRecorderDepartment()); + fishingTrip.setCreationDate(target.getCreationDate()); + fishingTrip.setSynchronizationStatus(target.getSynchronizationStatus()); + if (fishingTrip.getQualityFlag() == null) { + fishingTrip.setQualityFlag(qualityFlagDao.load(enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED)); + } + + if (fishingTrip.getReturnDateTime() == null && fishingTrip.getDepartureDateTime() != null) { + calendar.setTime(fishingTrip.getDepartureDateTime()); + calendar.add(Calendar.MILLISECOND, 1); // = departureDateTime + 1ms + fishingTrip.setReturnDateTime(calendar.getTime()); + } + + // Country + if (copyIfNull && source.getCountry() == null || source.getCountry().getId() == null) { + fishingTrip.setDepartureLocation(null); + fishingTrip.setReturnLocation(null); + } else if (source.getCountry() != null && source.getCountry().getId() != null) { + Location locationCountry = locationDao.load(Integer.valueOf(source.getCountry().getId())); + fishingTrip.setDepartureLocation(locationCountry); + fishingTrip.setReturnLocation(locationCountry); + } + + // Gear + if (copyIfNull && source.isGearEmpty()) { + miscDataBuffer.append(CRUISE_MISC_DATA_GEARS_TAG); + } else if (!source.isGearEmpty()) { + //throw new UnsupportedOperationException("Cruise could not yet support gears storage."); + miscDataBuffer.append(CRUISE_MISC_DATA_GEARS_TAG); + for (int i = 0; i < source.getGear().size(); i++) { + if (i > 0) miscDataBuffer.append(','); + miscDataBuffer.append(source.getGear().get(i).getId()); + } + } + + // Save miscDataBuffer into comments + // TODO BLA : vérifier que les UI Allegro n'utilise pas ce commentaires, + // mais bien celui de scientificCruise + fishingTrip.setComments(miscDataBuffer.toString()); + } + +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,42 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.FishingOperation; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("fishingOperationPersistenceService") +@Transactional(readOnly = true) +public class FishingOperationPersistenceServiceImpl extends AbstractPersistenceService implements FishingOperationPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(FishingOperationPersistenceServiceImpl.class); + + @Override + public List<FishingOperation> getAllFishingOperation(String cruiseId) { + return null; + } + + @Override + public FishingOperation getFishingOperation(String id) { + return null; + } + + @Override + public FishingOperation createFishingOperation(FishingOperation bean) { + return null; + } + + @Override + public FishingOperation saveFishingOperation(FishingOperation bean) { + return null; + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,46 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("macroWasteBatchPersistenceService") +@Transactional(readOnly = true) +public class MacroWasteBatchPersistenceServiceImpl extends AbstractPersistenceService implements MacroWasteBatchPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(MacroWasteBatchPersistenceServiceImpl.class); + + @Override + public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) { + return null; + } + + @Override + public MacroWasteBatch getMacroWasteBatch(String id) { + return null; + } + + @Override + public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) { + return null; + } + + @Override + public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) { + return null; + } + + @Override + public void deleteMacroWasteBatch(String id) { + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,46 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("planktonBatchPersistenceService") +@Transactional(readOnly = true) +public class PlanktonBatchPersistenceServiceImpl extends AbstractPersistenceService implements PlanktonBatchPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(PlanktonBatchPersistenceServiceImpl.class); + + @Override + public List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId) { + return null; + } + + @Override + public PlanktonBatch getPlanktonBatch(String id) { + return null; + } + + @Override + public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) { + return null; + } + + @Override + public PlanktonBatch savePlanktonBatch(PlanktonBatch bean) { + return null; + } + + @Override + public void deletePlanktonBatch(String id) { + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,82 @@ +package fr.ifremer.tutti.persistence.service; + +import com.google.common.collect.Lists; +import fr.ifremer.tutti.persistence.entities.data.Program; +import fr.ifremer.tutti.persistence.entities.referential.Zone; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hibernate.type.StringType; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Iterator; +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("programPersistenceService") +@Transactional(readOnly = true) +public class ProgramPersistenceServiceImpl extends AbstractPersistenceService implements ProgramPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(ProgramPersistenceServiceImpl.class); + + @Override + public List<Program> getAllProgram() { + Iterator<Object[]> list = queryList("allPrograms"); + + List<Program> result = Lists.newArrayList(); + while (list.hasNext()) { + Object[] source = list.next(); + Program target = new Program(); + target.setId((String) source[0]); + target.setName((String) source[1]); + result.add(target); + } + return result; + } + + @Override + public Program getProgram(String id) { + Object[] source = queryUnique( + "program", + "programCode", StringType.INSTANCE, id); + + Program result = new Program(); + result.setId((String) source[0]); + result.setName((String) source[1]); + + // get program locations + Iterator<Object[]> list = queryList( + "allProgramLocations", + "programCode", StringType.INSTANCE, id); + + List<Zone> zones = Lists.newArrayList(); + while (list.hasNext()) { + Object[] zoneSource = list.next(); + Zone target = new Zone(); + target.setId(String.valueOf(zoneSource[0])); + target.setLabel((String) zoneSource[1]); + target.setName((String) zoneSource[2]); + zones.add(target); + } + if (!zones.isEmpty()) { + result.setZone(zones.get(0)); + } + + return result; + } + + @Override + public Program createProgram(Program bean) { + throw new UnsupportedOperationException(); + } + + @Override + public Program saveProgram(Program bean) { + throw new UnsupportedOperationException(); + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,42 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("protocolPersistenceService") +@Transactional(readOnly = true) +public class ProtocolPersistenceServiceImpl extends AbstractPersistenceService implements ProtocolPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(ProtocolPersistenceServiceImpl.class); + + @Override + public List<TuttiProtocol> getAllProtocol() { + return null; + } + + @Override + public TuttiProtocol getProtocol(String id) { + return null; + } + + @Override + public TuttiProtocol createProtocol(TuttiProtocol bean) { + return null; + } + + @Override + public TuttiProtocol saveProtocol(TuttiProtocol bean) { + return null; + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -26,11 +26,9 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; - import fr.ifremer.adagio.core.dao.referential.StatusDao; -import fr.ifremer.adagio.core.dao.referential.taxon.TaxonRefTaxVO; import fr.ifremer.adagio.core.dao.referential.taxon.TaxonNameExtendDao; -import fr.ifremer.tutti.persistence.TuttiEnumerationFile; +import fr.ifremer.adagio.core.dao.referential.taxon.TaxonRefTaxVO; import fr.ifremer.tutti.persistence.entities.referential.AbstractTuttiReferentialEntity; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; @@ -45,12 +43,10 @@ import org.apache.commons.logging.Log; 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.StringType; -import org.hibernate.type.Type; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @@ -65,30 +61,20 @@ * @author tchemit <chemit@codelutin.com> * @since 0.3 */ +@Service("referentialPersistenceService") @Transactional(readOnly = true) -public class ReferentialPersistenceServiceImpl implements ReferentialPersistenceService { +public class ReferentialPersistenceServiceImpl extends AbstractPersistenceService implements ReferentialPersistenceService { /** Logger. */ private static final Log log = LogFactory.getLog(ReferentialPersistenceServiceImpl.class); - /** - * Session factory. - * - * @since 0.3 - */ - @Autowired(required = true) - protected SessionFactory sessionFactory; - @Resource(name = "taxonNameDao") protected TaxonNameExtendDao taxonNameDao; - + @Resource(name = "statusDao") - protected StatusDao statusDao; + protected StatusDao statusDao; - @Autowired(required = true) - protected TuttiEnumerationFile enumeration; - //------------------------------------------------------------------------// //-- ReferentialPersistenceService implentation --// //------------------------------------------------------------------------// @@ -124,7 +110,7 @@ Country target = new Country(); target.setId(String.valueOf(source[0])); target.setLabel((String) source[1]); - target.setName((String) source[2]); + target.setName((String) source[2]); setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target); result.add(target); } @@ -164,10 +150,9 @@ return result; } - @Override public Vessel getVessel(String vesselCode) { - Object[] source = queryUnique( + Object[] source = queryUniqueWithStatus( "vessel", "vesselCode", StringType.INSTANCE, vesselCode, "refDate", DateType.INSTANCE, new Date()); @@ -493,10 +478,10 @@ protected FishingOperationLocation loadFishingOperationLocation(Object[] source) { FishingOperationLocation target = new FishingOperationLocation(); target.setId(String.valueOf(source[0])); - target.setName((String)source[1]); - target.setLabel((String)source[2]); + target.setName((String) source[1]); + target.setLabel((String) source[2]); // target.setDescription((String)source[3]); - target.setLocationLevel((Integer)source[3]); + target.setLocationLevel((Integer) source[3]); setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target); return target; @@ -525,8 +510,8 @@ protected Gear loadGear(Object[] source) { Gear result = new Gear(); result.setId(String.valueOf(source[0])); - result.setName((String)source[1]); - result.setLabel((String)source[2]); + result.setName((String) source[1]); + result.setLabel((String) source[2]); setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], result); return result; } @@ -551,12 +536,6 @@ return result; } - protected Iterator<Object[]> queryList(String queryName, Object... params) { - Query query = createQuery(queryName, params); - Iterator result = query.iterate(); - return result; - } - protected Object[] queryUniqueWithStatus(String queryName, Object... params) { Query query = createQuery(queryName, params); @@ -567,37 +546,5 @@ return (Object[]) result; } - protected Object[] queryUnique(String queryName, Object... params) { - Query query = createQuery(queryName, params); - Object result = query.uniqueResult(); - return (Object[]) result; - } - - protected Query createQuery(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 + "])"); - } - } - } - return query; - } - - } Added: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java (rev 0) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,66 @@ +package fr.ifremer.tutti.persistence.service; + +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Service("speciesBatchPersistenceService") +@Transactional(readOnly = true) +public class SpeciesBatchPersistenceServiceImpl extends AbstractPersistenceService implements SpeciesBatchPersistenceService { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(SpeciesBatchPersistenceServiceImpl.class); + + @Override + public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) { + return null; + } + + @Override + public List<SpeciesBatch> getAllSpeciesBatch(String fishingOperationId) { + return null; + } + + @Override + public SpeciesBatch getSpeciesBatch(String id) { + return null; + } + + @Override + public SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentBatchId) { + return null; + } + + @Override + public SpeciesBatch saveSpeciesBatch(SpeciesBatch bean) { + return null; + } + + @Override + public void deleteSpeciesBatch(String id) { + } + + @Override + public void deleteSpeciesSubBatch(String id) { + } + + @Override + public List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency(String speciesBatchId) { + return null; + } + + @Override + public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, List<SpeciesBatchFrequency> frequencies) { + return null; + } +} Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java =================================================================== --- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-01-14 13:22:48 UTC (rev 189) @@ -39,12 +39,11 @@ new TuttiPersistenceServiceLocator(); protected TuttiPersistenceServiceLocator() { - super("beanRefFactory.xml", - "TuttiBeanRefFactory"); + super("beanRefFactory.xml", "TuttiBeanRefFactory"); } public static TuttiPersistence getPersistenceService() { - return INSTANCE.getService("adagioPersistenceService", + return INSTANCE.getService("tuttiPersistence", TuttiPersistence.class); } @@ -53,6 +52,51 @@ ReferentialPersistenceService.class); } + public static ProgramPersistenceService getProgramPersistenceService() { + return INSTANCE.getService("programPersistenceService", + ProgramPersistenceService.class); + } + + public static CruisePersistenceService getCruisePersistenceService() { + return INSTANCE.getService("cruisePersistenceService", + CruisePersistenceService.class); + } + + public static FishingOperationPersistenceService getFishingOperationPersistenceService() { + return INSTANCE.getService("fishingOperationPersistenceService", + FishingOperationPersistenceService.class); + } + + public static SpeciesBatchPersistenceService getSpeciesBatchPersistenceService() { + return INSTANCE.getService("speciesBatchPersistenceService", + SpeciesBatchPersistenceService.class); + } + + public static BenthosBatchPersistenceService getBenthosBatchPersistenceService() { + return INSTANCE.getService("benthosBatchPersistenceService", + BenthosBatchPersistenceService.class); + } + + public static PlanktonBatchPersistenceService getPlanktonBatchPersistenceService() { + return INSTANCE.getService("planktonBatchPersistenceService", + PlanktonBatchPersistenceService.class); + } + + public static MacroWasteBatchPersistenceService getMacroWasteBatchPersistenceService() { + return INSTANCE.getService("macroWasteBatchPersistenceService", + MacroWasteBatchPersistenceService.class); + } + + public static AccidentalBatchPersistenceService getAccidentalBatchPersistenceService() { + return INSTANCE.getService("accidentalBatchPersistenceService", + AccidentalBatchPersistenceService.class); + } + + public static ProtocolPersistenceService getProtocolPersistenceService() { + return INSTANCE.getService("protocolPersistenceService", + ProtocolPersistenceService.class); + } + public static void close() { INSTANCE.shutdown(); } 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-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/resources/applicationContext-service-tutti.xml 2013-01-14 13:22:48 UTC (rev 189) @@ -25,443 +25,16 @@ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" - xsi:schemaLocation="http://www.springframework.org/schema/tx - http://www.springframework.org/schema/tx/spring-tx-3.0.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - <!-- 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 /> + <context:component-scan base-package="fr.ifremer.tutti.persistence.service"/> - <!--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 - from outside) --> - <tx:annotation-driven transaction-manager="transactionManager"/> - - <bean id="locationService" - class="fr.ifremer.adagio.core.service.referential.location.impl.LocationServiceImpl"/> - - <bean id="referentialPersistenceService" - class="fr.ifremer.tutti.persistence.service.ReferentialPersistenceServiceImpl"/> - - <bean id="adagioPersistenceService" init-method="open" destroy-method="close" + <bean id="tuttiPersistence" init-method="open" destroy-method="close" class="fr.ifremer.tutti.persistence.TuttiPersistenceAdagioImpl"/> <bean init-method="init" class="fr.ifremer.tutti.persistence.TuttiEnumerationFile"/> - <!--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/beanRefFactory.xml =================================================================== --- trunk/tutti-persistence-adagio/src/main/resources/beanRefFactory.xml 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/resources/beanRefFactory.xml 2013-01-14 13:22:48 UTC (rev 189) @@ -38,7 +38,7 @@ <value>applicationContext-conf.xml</value> <value>applicationContext-dataSource-${dataSource.type}.xml</value> <value>applicationContext-entities.xml</value> - <!--<value>applicationContext-service.xml</value>--> + <value>applicationContext-service.xml</value> <value>applicationContext-service-tutti.xml</value> </list> </constructor-arg> 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-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-14 13:22:48 UTC (rev 189) @@ -38,85 +38,128 @@ <!-- [DAT-01] Get all programs (to list with no detail) --> <query cacheable="true" name="allPrograms"> <![CDATA[ - SELECT + SELECT p.code, p.name - FROM ProgramImpl p - WHERE p.code LIKE 'CAM-%' - ]]> + FROM + ProgramImpl p + WHERE + p.code LIKE 'CAM-%' + ]]> </query> <!-- [DAT-02] Get all cruises for a given program (to list with no detail) --> <query cacheable="true" name="allCruises"> <![CDATA[ - SELECT + SELECT c.id, c.name, c.departureDateTime - FROM ScientificCruiseImpl c - WHERE c.program.code = :programCode - ORDER BY c.departureDateTime desc - ]]> + FROM + ScientificCruiseImpl c + WHERE + c.program.code = :programCode + ORDER BY + c.departureDateTime desc + ]]> <query-param name="programCode" type="java.lang.String"/> </query> <!-- [DAT-03] Get a detail program --> <query cacheable="true" name="program"> <![CDATA[ - SELECT + SELECT p.code, p.name, p.description - FROM ProgramImpl p - WHERE p.code = :programCode - ]]> + FROM + ProgramImpl p + WHERE + p.code = :programCode + ]]> <query-param name="programCode" type="java.lang.String"/> </query> <!-- [DAT-03-1] Get a program locations --> <query cacheable="true" name="allProgramLocations"> <![CDATA[ - SELECT + SELECT l.id, l.label, l.name - FROM ProgramImpl p + FROM + ProgramImpl p LEFT OUTER JOIN p.locations l - WHERE p.code = :programCode - ]]> + WHERE + p.code = :programCode + ]]> <query-param name="programCode" type="java.lang.String"/> </query> <!-- [DAT-04] Get a detail cruise --> <query cacheable="true" name="cruise"> <![CDATA[ -SELECT - sc.program.code AS programCode, - year(sc.departureDateTime) AS year, - sc.name AS name, - lh.locationHierarchyPk.parent.id AS countryId, - lh.locationHierarchyPk.parent.label AS countryLabel, - lh.locationHierarchyPk.parent.name AS countryName, - sc.departureDateTime AS departureDateTime, - sc.returnDateTime AS returnDateTime, - sc.vessel.code AS vesselCode, - mp.id AS managerId, - sc.comments AS scientificCruiseComments, - ft.comments AS fishingTripComments - FROM - ScientificCruiseImpl sc - LEFT OUTER JOIN sc.fishingTrips ft - LEFT OUTER JOIN sc.managerPerson mp, - LocationHierarchyImpl lh - WHERE - sc.id = :cruiseId - AND lh.locationHierarchyPk.location.id = ft.departureLocation.id - AND lh.locationHierarchyPk.parent.locationLevel.id = :countryLocationLevelId - ]]> - <query-param name="cruiseId" type="java.lang.String"/> + SELECT + sc.program.code AS programCode, + year(sc.departureDateTime) AS year, + sc.name AS name, + lh.locationHierarchyPk.parent.id AS countryId, + lh.locationHierarchyPk.parent.label AS countryLabel, + lh.locationHierarchyPk.parent.name AS countryName, + sc.departureDateTime AS departureDateTime, + sc.returnDateTime AS returnDateTime, + sc.vessel.code AS vesselCode, + mp.id AS managerId, + sc.comments AS scientificCruiseComments, + ft.comments AS fishingTripComments + FROM + ScientificCruiseImpl sc + LEFT OUTER JOIN sc.fishingTrips ft + LEFT OUTER JOIN sc.managerPerson mp, + LocationHierarchyImpl lh + WHERE + sc.id = :cruiseId + AND lh.locationHierarchyPk.parent.locationLevel.id = :countryLocationLevelId + AND lh.locationHierarchyPk.location.id = ft.departureLocation.id + ]]> + <query-param name="cruiseId" type="java.lang.Integer"/> <query-param name="countryLocationLevelId" type="java.lang.Integer"/> </query> + <query cacheable="true" name="allCruiseGears"> + <![CDATA[ + SELECT + gpf.gear.id AS gearId, + gpf.gear.label AS gearLabel, + gpf.gear.name AS gearName + FROM + ScientificCruiseImpl sc + JOIN sc.fishingTrips ft + JOIN ft.gearPhysicalFeatures gpf + LEFT OUTER JOIN gpf.operations o + WHERE + sc.id = :cruiseId + ]]> + <query-param name="cruiseId" type="java.lang.Integer"/> + </query> + + <query cacheable="true" name="allCruiseSecondaryVessels"> + <![CDATA[ + SELECT + va.operationVesselAssociationPk.vessel.code AS associatedVesselCode, + FROM + ScientificCruiseImpl sc + JOIN sc.fishingTrips ft + JOIN ft.operations o + JOIN o.operationVesselAssociations va + WHERE + sc.id = :cruiseId + GROUP BY + va.operationVesselAssociationPk.vessel + ]]> + <query-param name="cruiseId" type="java.lang.Integer"/> + </query> + <!-- ===================================================================== --> <!-- === Requete techniques sur référentiels [REF-TXXX] === --> <!-- ===================================================================== --> Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,67 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.Program; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link Program}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class AccidentalBatchTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllAccidentalBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getAccidentalBatch(/*String id*/) { - - } - - @Test - public void createAccidentalBatch(/*AccidentalBatch bean*/) { - - } - - @Test - public void saveAccidentalBatch(/*AccidentalBatch bean*/) { - - } - - @Test - public void deleteAccidentalBatch(/*String id*/) { - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,67 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.Program; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link Program}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class BenthosBatchTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllBenthosBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getBenthosBatch(/*String id*/) { - - } - - @Test - public void createBenthosBatch(/*BenthosBatch bean*/) { - - } - - @Test - public void saveBenthosBatch(/*BenthosBatch bean*/) { - - } - - @Test - public void deleteBenthosBatch(/*String id*/) { - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,169 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 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 static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.Iterator; -import java.util.List; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -import com.google.common.collect.Lists; - -import fr.ifremer.tutti.persistence.entities.data.Cruise; -import fr.ifremer.tutti.persistence.entities.data.Program; -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.Vessel; -import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator; - -/** - * To test operations around {@link Program}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class CruiseTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - protected TuttiPersistence service; - - @Before - public void setUp() throws Exception { - service = TuttiPersistenceServiceLocator.getPersistenceService(); - } - - @Test - public void getAllCruise(/*String programId*/) { - String programCode = dbResource.getFixtures().programCode(); - List<Cruise> result = service.getAllCruise(programCode); - Assert.assertNotNull(result); - Assert.assertEquals(1, result.size()); - } - - @Test - public void getCruise(/*String id*/) { - - String cruiseId = dbResource.getFixtures().cruiseId(); - Cruise result = service.getCruise(cruiseId); - Assert.assertNotNull(result); - } - - @Test - public void createCruise(/*Cruise bean*/) { - String programCode = dbResource.getFixtures().programCode(); - Cruise cruise = new Cruise(); - - cruise.setId(null); - - cruise.setName("CGFS_2013"); - - cruise.setProgram(service.getProgram(programCode)); - - Calendar calendar = new GregorianCalendar(); - cruise.setBeginDate(calendar.getTime()); - - cruise.setYear(calendar.get(Calendar.YEAR)); - - calendar.add(Calendar.MONTH, 1); // add one month - cruise.setEndDate(calendar.getTime()); - - Country country = null; - List<Country> countries = service.getAllCountry(); - for (Iterator iterator = countries.iterator(); iterator.hasNext();) { - Country aCountry = (Country) iterator.next(); - if (aCountry.getLabel() != null && aCountry.getLabel().equals("FRA")) { - country = aCountry; - break; - } - } - assertNotNull("Could not load FRA country", country); - cruise.setCountry(country); - - List<Gear> gears = service.getAllFishingGear(); - cruise.setGear(gears); - - cruise.setComment("My comments on cruise"); - - Person managerPerson = service.getAllPerson().get(0); - cruise.setHeadOfMission(Lists.newArrayList(managerPerson)); - - List<Vessel> vessels = Lists.newArrayList(); - vessels.add(service.getAllScientificVessel().get(0)); - Vessel fishingVessel = new Vessel(); - fishingVessel.setId(dbResource.getFixtures().fishingVesselCode()); - vessels.add(fishingVessel); - - cruise.setVessel(vessels); - - Cruise createdCruise = service.createCruise(cruise); - assertNotNull(createdCruise); - assertNotNull(createdCruise.getId()); - assertEquals(cruise.getName(), createdCruise.getName()); - - // New cruise, with empty optional values - createdCruise.setId(null); - createdCruise.setHeadOfMission(null); - createdCruise.setBeginDate(null); - createdCruise.setEndDate(null); - createdCruise.setComment(null); - createdCruise.setPoche(null); - createdCruise = service.createCruise(cruise); - assertNotNull(createdCruise); - assertNotNull(createdCruise.getId()); - assertEquals(cruise.getName(), createdCruise.getName()); - - Cruise reloadedCruise = service.getCruise(createdCruise.getId()); - assertEquals(createdCruise.getBeginDate(), reloadedCruise.getBeginDate()); - assertEquals(createdCruise.getEndDate(), reloadedCruise.getEndDate()); - assertEquals(createdCruise.getComment(), reloadedCruise.getComment()); - assertEquals(createdCruise.getPoche(), reloadedCruise.getPoche()); - assertNull(reloadedCruise.getHeadOfMission()); - assertNotNull(reloadedCruise.getVessel()); - assertEquals(createdCruise.getVessel().get(0), reloadedCruise.getVessel().get(0)); - assertEquals(cruise.getCountry().getId(), reloadedCruise.getCountry().getId()); - assertNotNull(reloadedCruise.getVessel()); - assertEquals(vessels.size(), reloadedCruise.getVessel().size()); - assertNotNull(reloadedCruise.getGear()); - assertEquals(gears.size(), reloadedCruise.getGear().size()); - } - - @Test - public void saveCruise(/*Cruise bean*/) { - - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,63 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link FishingOperation}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class FishingOperationTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllFishingOperation(/*String cruiseId*/) { - - } - - @Test - public void getFishingOperation(/*String id*/) { - - } - - @Test - public void createFishingOperation(/*FishingOperation bean*/) { - - } - - @Test - public void saveFishingOperation(/*FishingOperation bean*/) { - - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,67 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.Program; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link Program}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class MacroWasteBatchTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllMacroWasteBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getMacroWasteBatch(/*String id*/) { - - } - - @Test - public void createMacroWasteBatch(/*MacroWasteBatch bean*/) { - - } - - @Test - public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) { - - } - - @Test - public void deleteMacroWasteBatch(/*String id*/) { - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,67 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.Program; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link Program}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class PlanktonBatchTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllPlanktonBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getPlanktonBatch(/*String id*/) { - - } - - @Test - public void createPlanktonBatch(/*PlanktonBatch bean*/) { - - } - - @Test - public void savePlanktonBatch(/*PlanktonBatch bean*/) { - - } - - @Test - public void deletePlanktonBatch(/*String id*/) { - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,84 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.Program; -import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator; -import org.junit.Assert; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.List; - -/** - * To test operations around {@link Program}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -public class ProgramTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - protected TuttiPersistence service; - - @Before - public void setUp() throws Exception { - service = TuttiPersistenceServiceLocator.getPersistenceService(); - } - - @Test - public void getAllProgram() { - List<Program> result = service.getAllProgram(); - Assert.assertNotNull(result); - Assert.assertEquals(1, result.size()); - } - - @Test - public void getProgram(/*String id*/) { - String programCode = dbResource.getFixtures().programCode(); - Program actual = service.getProgram(programCode); - Assert.assertNotNull(actual); - Assert.assertNotNull(actual.getId()); - Assert.assertNotNull(actual.getName()); - Assert.assertNotNull(actual.getZone()); - Assert.assertEquals(programCode, actual.getId()); - } - - @Test - @Ignore - public void createProgram(/*Program bean*/) { - - } - - @Test - @Ignore - public void saveProgram(/*Program bean*/) { - - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,63 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link TuttiProtocol}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class ProtocolTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllProtocol() { - - } - - @Test - public void getProtocol(/*String id*/) { - - } - - @Test - public void createProtocol(/*TuttiProtocol bean*/) { - - } - - @Test - public void saveProtocol(/*TuttiProtocol bean*/) { - - } -} Deleted: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -1,82 +0,0 @@ -package fr.ifremer.tutti.persistence; - -/* - * #%L - * Tutti :: Persistence Adagio (impl) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2012 - 2013 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.tutti.persistence.entities.data.Program; -import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Test; - -/** - * To test operations around {@link SpeciesBatch}. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.3 - */ -@Ignore -public class SpeciesBatchTest { - - @ClassRule - public static final DatabaseResource dbResource = new DatabaseResource(); - - @Test - public void getAllRootSpeciesBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getAllSpeciesBatch(/*String fishingOperationId*/) { - - } - - @Test - public void getSpeciesBatch(/*String id*/) { - - } - - @Test - public void createSpeciesBatch(/*SpeciesBatch bean, String parentBatchId*/) { - - } - - @Test - public void saveSpeciesBatch(/*SpeciesBatch bean*/) { - - } - - @Test - public void deleteSpeciesBatch(/*String id*/) { - } - - @Test - public void deleteSpeciesSubBatch(/*String id*/) { - } - - @Test - public void getAllSpeciesBatchFrequency(/*String speciesBatchId*/) { - - } -} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/AccidentalBatchTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,73 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class AccidentalBatchPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected AccidentalBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getAccidentalBatchPersistenceService(); + } + + @Test + public void getAllAccidentalBatch(/*String fishingOperationId*/) { + + } + + @Test + public void getAccidentalBatch(/*String id*/) { + + } + + @Test + public void createAccidentalBatch(/*AccidentalBatch bean*/) { + + } + + @Test + public void saveAccidentalBatch(/*AccidentalBatch bean*/) { + + } + + @Test + public void deleteAccidentalBatch(/*String id*/) { + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/BenthosBatchTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,73 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class BenthosBatchPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected BenthosBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getBenthosBatchPersistenceService(); + } + + @Test + public void getAllBenthosBatch(/*String fishingOperationId*/) { + + } + + @Test + public void getBenthosBatch(/*String id*/) { + + } + + @Test + public void createBenthosBatch(/*BenthosBatch bean*/) { + + } + + @Test + public void saveBenthosBatch(/*BenthosBatch bean*/) { + + } + + @Test + public void deleteBenthosBatch(/*String id*/) { + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/CruiseTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,177 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 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 com.google.common.collect.Lists; +import fr.ifremer.tutti.persistence.DatabaseResource; +import fr.ifremer.tutti.persistence.entities.data.Cruise; +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.Vessel; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assert; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; + +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class CruisePersistenceServiceTest { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(CruisePersistenceServiceTest.class); + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected ReferentialPersistenceService referentialService; + + protected ProgramPersistenceService programService; + + protected CruisePersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getCruisePersistenceService(); + referentialService = TuttiPersistenceServiceLocator.getReferentialPersistenceService(); + programService = TuttiPersistenceServiceLocator.getProgramPersistenceService(); + } + + @Test + public void getAllCruise(/*String programId*/) { + String programCode = dbResource.getFixtures().programCode(); + List<Cruise> result = service.getAllCruise(programCode); + Assert.assertNotNull(result); + Assert.assertFalse(result.isEmpty()); + } + + @Test + public void getCruise(/*String id*/) { + + String cruiseId = dbResource.getFixtures().cruiseId(); + Cruise result = service.getCruise(cruiseId); + Assert.assertNotNull(result); + } + + @Test + public void createCruise(/*Cruise bean*/) { + String programCode = dbResource.getFixtures().programCode(); + Cruise cruise = new Cruise(); + + cruise.setId(null); + + cruise.setName("CGFS_2013"); + + cruise.setProgram(programService.getProgram(programCode)); + + Calendar calendar = new GregorianCalendar(); + cruise.setBeginDate(calendar.getTime()); + + cruise.setYear(calendar.get(Calendar.YEAR)); + + calendar.add(Calendar.MONTH, 1); // add one month + cruise.setEndDate(calendar.getTime()); + + Country country = null; + List<Country> countries = referentialService.getAllCountry(); + for (Country aCountry : countries) { + if (aCountry.getLabel() != null && aCountry.getLabel().equals("FRA")) { + country = aCountry; + break; + } + } + assertNotNull("Could not load FRA country", country); + cruise.setCountry(country); + + List<Gear> gears = referentialService.getAllFishingGear(); + cruise.setGear(gears); + + cruise.setComment("My comments on cruise"); + + Person managerPerson = referentialService.getAllPerson().get(0); + cruise.setHeadOfMission(Lists.newArrayList(managerPerson)); + + List<Vessel> vessels = Lists.newArrayList(); + vessels.add(referentialService.getAllScientificVessel().get(0)); + Vessel fishingVessel = new Vessel(); + fishingVessel.setId(dbResource.getFixtures().fishingVesselCode()); + vessels.add(fishingVessel); + + cruise.setVessel(vessels); + + Cruise createdCruise = service.createCruise(cruise); + assertNotNull(createdCruise); + assertNotNull(createdCruise.getId()); + assertEquals(cruise.getName(), createdCruise.getName()); + + if (log.isInfoEnabled()) { + log.info("Created cruise: " + createdCruise.getId()); + } + + // New cruise, with empty optional values + createdCruise.setId(null); + createdCruise.setHeadOfMission(null); + createdCruise.setBeginDate(null); + createdCruise.setEndDate(null); + createdCruise.setComment(null); + createdCruise.setPoche(null); + createdCruise = service.createCruise(cruise); + assertNotNull(createdCruise); + assertNotNull(createdCruise.getId()); + assertEquals(cruise.getName(), createdCruise.getName()); + + Cruise reloadedCruise = service.getCruise(createdCruise.getId()); + assertEquals(createdCruise.getBeginDate(), reloadedCruise.getBeginDate()); + assertEquals(createdCruise.getEndDate(), reloadedCruise.getEndDate()); + assertEquals(createdCruise.getComment(), reloadedCruise.getComment()); + assertEquals(createdCruise.getPoche(), reloadedCruise.getPoche()); + assertNull(reloadedCruise.getHeadOfMission()); + assertNotNull(reloadedCruise.getVessel()); + assertEquals(createdCruise.getVessel().get(0), reloadedCruise.getVessel().get(0)); + assertEquals(cruise.getCountry().getId(), reloadedCruise.getCountry().getId()); + assertNotNull(reloadedCruise.getVessel()); + assertEquals(vessels.size(), reloadedCruise.getVessel().size()); + assertNotNull(reloadedCruise.getGear()); + assertEquals(gears.size(), reloadedCruise.getGear().size()); + } + + @Test + public void saveCruise(/*Cruise bean*/) { + + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/FishingOperationTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,69 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class FishingOperationPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected FishingOperationPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getFishingOperationPersistenceService(); + } + + @Test + public void getAllFishingOperation(/*String cruiseId*/) { + + } + + @Test + public void getFishingOperation(/*String id*/) { + + } + + @Test + public void createFishingOperation(/*FishingOperation bean*/) { + + } + + @Test + public void saveFishingOperation(/*FishingOperation bean*/) { + + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/MacroWasteBatchTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,73 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class MacroWasteBatchPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected MacroWasteBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getMacroWasteBatchPersistenceService(); + } + + @Test + public void getAllMacroWasteBatch(/*String fishingOperationId*/) { + + } + + @Test + public void getMacroWasteBatch(/*String id*/) { + + } + + @Test + public void createMacroWasteBatch(/*MacroWasteBatch bean*/) { + + } + + @Test + public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) { + + } + + @Test + public void deleteMacroWasteBatch(/*String id*/) { + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/PlanktonBatchTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,74 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import fr.ifremer.tutti.persistence.entities.data.Program; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class PlanktonBatchPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected PlanktonBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getPlanktonBatchPersistenceService(); + } + + @Test + public void getAllPlanktonBatch(/*String fishingOperationId*/) { + + } + + @Test + public void getPlanktonBatch(/*String id*/) { + + } + + @Test + public void createPlanktonBatch(/*PlanktonBatch bean*/) { + + } + + @Test + public void savePlanktonBatch(/*PlanktonBatch bean*/) { + + } + + @Test + public void deletePlanktonBatch(/*String id*/) { + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProgramTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,82 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import fr.ifremer.tutti.persistence.entities.data.Program; +import org.junit.Assert; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class ProgramPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected ProgramPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getProgramPersistenceService(); + } + + @Test + public void getAllProgram() { + List<Program> result = service.getAllProgram(); + Assert.assertNotNull(result); + Assert.assertEquals(1, result.size()); + } + + @Test + public void getProgram(/*String id*/) { + String programCode = dbResource.getFixtures().programCode(); + Program actual = service.getProgram(programCode); + Assert.assertNotNull(actual); + Assert.assertNotNull(actual.getId()); + Assert.assertNotNull(actual.getName()); + Assert.assertNotNull(actual.getZone()); + Assert.assertEquals(programCode, actual.getId()); + } + + @Test + @Ignore + public void createProgram(/*Program bean*/) { + + } + + @Test + @Ignore + public void saveProgram(/*Program bean*/) { + + } +} Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ProtocolTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,69 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class ProtocolPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected ProtocolPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getProtocolPersistenceService(); + } + + @Test + public void getAllProtocol() { + + } + + @Test + public void getProtocol(/*String id*/) { + + } + + @Test + public void createProtocol(/*TuttiProtocol bean*/) { + + } + + @Test + public void saveProtocol(/*TuttiProtocol bean*/) { + + } +} Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java 2013-01-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -53,8 +53,6 @@ import java.util.List; /** - * Test the referential service. - * * @author tchemit <chemit@codelutin.com> * @since 0.3 */ @@ -81,7 +79,8 @@ TuttiPersistenceDevConfig devDriverConfig = new TuttiPersistenceDevConfig(applicationConfig); - applicationConfig.setOption(TuttiPersistenceDevImpl.SKIP_FIXTURES_OPTION, Boolean.TRUE.toString()); + applicationConfig.setOption( + TuttiPersistenceDevImpl.SKIP_FIXTURES_OPTION, Boolean.TRUE.toString()); storage = new TuttiPersistenceDevImpl(devDriverConfig) { Copied: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceTest.java (from rev 188, trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/SpeciesBatchTest.java) =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceTest.java (rev 0) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceTest.java 2013-01-14 13:22:48 UTC (rev 189) @@ -0,0 +1,87 @@ +package fr.ifremer.tutti.persistence.service; + +/* + * #%L + * Tutti :: Persistence Adagio (impl) + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.persistence.DatabaseResource; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +@Ignore +public class SpeciesBatchPersistenceServiceTest { + + @ClassRule + public static final DatabaseResource dbResource = new DatabaseResource(); + + protected SpeciesBatchPersistenceService service; + + @Before + public void setUp() throws Exception { + service = TuttiPersistenceServiceLocator.getSpeciesBatchPersistenceService(); + } + + @Test + public void getAllRootSpeciesBatch(/*String fishingOperationId*/) { + + } + + @Test + public void getAllSpeciesBatch(/*String fishingOperationId*/) { + + } + + @Test + public void getSpeciesBatch(/*String id*/) { + + } + + @Test + public void createSpeciesBatch(/*SpeciesBatch bean, String parentBatchId*/) { + + } + + @Test + public void saveSpeciesBatch(/*SpeciesBatch bean*/) { + + } + + @Test + public void deleteSpeciesBatch(/*String id*/) { + } + + @Test + public void deleteSpeciesSubBatch(/*String id*/) { + } + + @Test + public void getAllSpeciesBatchFrequency(/*String speciesBatchId*/) { + + } +} 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-14 11:00:11 UTC (rev 188) +++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2013-01-14 13:22:48 UTC (rev 189) @@ -343,6 +343,7 @@ return referentialPersistenceService.getAllPerson(); } + @Override public Person getPerson(Integer personId) { return referentialPersistenceService.getPerson(personId); } @@ -438,7 +439,6 @@ return result; } - //------------------------------------------------------------------------// //-- FishingOperation methods --// //------------------------------------------------------------------------// 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-14 11:00:11 UTC (rev 188) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-01-14 13:22:48 UTC (rev 189) @@ -274,6 +274,16 @@ return devDriver.getMacroWasteSizeCategoryCaracteristic(); } + @Override + public Vessel getVessel(String vesselCode) { + return devDriver.getVessel(vesselCode); + } + + @Override + public Person getPerson(Integer personId) { + return devDriver.getPerson(personId); + } + //------------------------------------------------------------------------// //-- Program methods --// //------------------------------------------------------------------------//
participants (1)
-
tchemit@users.forge.codelutin.com