r793 - trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service
Author: tchemit Date: 2013-04-16 12:01:18 +0200 (Tue, 16 Apr 2013) New Revision: 793 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/793 Log: fixes #2297: [TRAIT] erreur ?\195?\160 la cr?\195?\169ation d'un premier trait sur une nouvelle campagne Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java 2013-04-16 07:32:28 UTC (rev 792) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java 2013-04-16 10:01:18 UTC (rev 793) @@ -26,7 +26,6 @@ import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import fr.ifremer.adagio.core.dao.data.batch.Batch; @@ -403,7 +402,7 @@ { if (batch.getChildBatchs() == null) { - batch.setChildBatchs(Lists.<Batch>newArrayList()); + batch.setChildBatchs(Sets.<Batch>newHashSet()); } Map<Integer, SortingBatch> batchChilds = getChildsMap(batch, enumeration.PMFM_ID_SORTING_TYPE); @@ -430,7 +429,7 @@ { if (speciesBatch.getChildBatchs() == null) { - speciesBatch.setChildBatchs(Lists.<Batch>newArrayList()); + speciesBatch.setChildBatchs(Sets.<Batch>newHashSet()); } Map<Integer, SortingBatch> speciesBatchChilds = getChildsMap(speciesBatch, enumeration.PMFM_ID_SORTING_TYPE_2); @@ -519,7 +518,7 @@ { if (benthosBatch.getChildBatchs() == null) { - benthosBatch.setChildBatchs(Lists.<Batch>newArrayList()); + benthosBatch.setChildBatchs(Sets.<Batch>newHashSet()); } Map<Integer, SortingBatch> benthosBatchChilds = getChildsMap(benthosBatch, enumeration.PMFM_ID_SORTING_TYPE_2); @@ -610,7 +609,9 @@ { Map<Integer, SortingBatch> batchChilds = getChildsMap(batch, enumeration.PMFM_ID_SORTING_TYPE); - batch.setChildBatchs(Lists.<Batch>newArrayList()); + if (batch.getChildBatchs() == null) { + batch.setChildBatchs(Sets.<Batch>newHashSet()); + } // ----------------------------------------------------------------------------- // Hors Vrac > Species // ----------------------------------------------------------------------------- @@ -619,11 +620,6 @@ if (speciesBatch == null) { speciesBatch = SortingBatch.Factory.newInstance(); batch.getChildBatchs().add(speciesBatch); -// if (batch.getChildBatchs() == null) { -// batch.setChildBatchs(Lists.newArrayList((Batch) speciesBatch)); -// } else { -// batch.getChildBatchs().add(speciesBatch); -// } } beanToEntitySortingBatch(target, batch,
participants (1)
-
tchemit@users.forge.codelutin.com