Author: tchemit Date: 2013-04-04 13:05:45 +0200 (Thu, 04 Apr 2013) New Revision: 733 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/733 Log: reformat code + remove fqn on classes Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java 2013-04-04 11:02:34 UTC (rev 732) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java 2013-04-04 11:05:45 UTC (rev 733) @@ -27,6 +27,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import fr.ifremer.adagio.core.dao.data.batch.Batch; +import fr.ifremer.adagio.core.dao.data.batch.CatchBatch; import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao; import fr.ifremer.adagio.core.dao.data.batch.SortingBatch; import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory; @@ -81,16 +82,17 @@ Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId)); Preconditions.checkNotNull(catchBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); Preconditions.checkNotNull(catchBatch); Collection<Batch> catchBatchChils = catchBatch.getChildBatchs(); // Vrac / Benthos - SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatchChils, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED + SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch( + catchBatchChils, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED ); BatchContainer<SpeciesBatch> result = new BatchContainer<SpeciesBatch>(); @@ -108,9 +110,11 @@ } // Hors-Vrac / Benthos - SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatchChils, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID, - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); + SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch( + catchBatchChils, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS + ); if (horsVracSpeciesBatch != null) { for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) { @@ -139,7 +143,7 @@ // Load full batch tree Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(bean.getFishingOperation().getIdAsInt()); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); SortingBatch batch = SortingBatch.Factory.newInstance(); benthosBatchToEntity(bean, batch, parentBatchId, catchBatch); @@ -161,7 +165,7 @@ Integer catchBatchId = catchBatchDao.getIdBySortingBatchId(bean.getIdAsInt()); Preconditions.checkNotNull(catchBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); Preconditions.checkNotNull(catchBatch); getCurrentSession().setFlushMode(FlushMode.COMMIT); @@ -218,7 +222,7 @@ return results; } - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); SortingBatch sortingBatch = catchBatchDao.getSortingBatchById(catchBatch, Integer.valueOf(benthosBatchId)); @@ -253,7 +257,7 @@ Integer sortingBatchId = Integer.valueOf(benthosBatchId); Integer catchBatchId = catchBatchDao.getIdBySortingBatchId(sortingBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); if (catchBatch == null) { return frequencies; @@ -325,7 +329,12 @@ protected void benthosBatchToEntity(SpeciesBatch source, SortingBatch target, String parentBatchId, - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { - batchHelper.speciesBatchToEntity(source, target, parentBatchId, catchBatch, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); + CatchBatch catchBatch) { + batchHelper.speciesBatchToEntity( + source, + target, + parentBatchId, + catchBatch, + enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); } } Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java 2013-04-04 11:02:34 UTC (rev 732) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java 2013-04-04 11:05:45 UTC (rev 733) @@ -27,6 +27,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import fr.ifremer.adagio.core.dao.data.batch.Batch; +import fr.ifremer.adagio.core.dao.data.batch.CatchBatch; import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao; import fr.ifremer.adagio.core.dao.data.batch.SortingBatch; import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory; @@ -78,16 +79,17 @@ Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId)); Preconditions.checkNotNull(catchBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); Preconditions.checkNotNull(catchBatch); Collection<Batch> catchBatchChilds = catchBatch.getChildBatchs(); // Vrac / Species - SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatchChilds, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES, - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED - ); + SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch( + catchBatchChilds, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED + ); // container of speciesBatch is arbitraty put on vrac type (there is // no common ancestor for all species batch). @@ -107,9 +109,10 @@ } // Hors-Vrac / Species - SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatchChilds, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID, - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); + SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch( + catchBatchChilds, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID, + BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); if (horsVracSpeciesBatch != null) { for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) { @@ -139,7 +142,7 @@ // Load full batch tree Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(bean.getFishingOperation().getIdAsInt()); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); SortingBatch batch = SortingBatch.Factory.newInstance(); speciesBatchToEntity(bean, batch, parentBatchId, catchBatch); @@ -161,7 +164,7 @@ Integer catchBatchId = catchBatchDao.getIdBySortingBatchId(bean.getIdAsInt()); Preconditions.checkNotNull(catchBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); Preconditions.checkNotNull(catchBatch); getCurrentSession().setFlushMode(FlushMode.COMMIT); @@ -222,7 +225,7 @@ catchBatchId, "Could not find catchBatch for speciesBatch: " + speciesBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); SortingBatch sortingBatch = catchBatchDao.getSortingBatchById( @@ -266,7 +269,7 @@ Integer sortingBatchId = Integer.valueOf(speciesBatchId); Integer catchBatchId = catchBatchDao.getIdBySortingBatchId(sortingBatchId); - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); + CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId); if (catchBatch == null) { return notNullFrequencies; @@ -359,8 +362,13 @@ protected void speciesBatchToEntity(SpeciesBatch source, SortingBatch target, String parentBatchId, - fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { - batchHelper.speciesBatchToEntity(source, target, parentBatchId, catchBatch, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); + CatchBatch catchBatch) { + batchHelper.speciesBatchToEntity( + source, + target, + parentBatchId, + catchBatch, + enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); } }
participants (1)
-
tchemit@users.forge.codelutin.com