Commit 0d784d9a authored by PECQUOT's avatar PECQUOT
Browse files

Merge branch 'release/3.7.1'

parents 3a71f877 6db01ecd
## Sprint 74 - v3.7.1
- Aucune mise à jour de base de données
## Sprint 73 - v3.7.0
- Aucune mise à jour de base de données
......
......@@ -10,7 +10,7 @@
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.7.0</version>
<version>3.7.1</version>
<packaging>pom</packaging>
<name>Reef DB</name>
......@@ -178,7 +178,7 @@
<maven.compiler.debug>true</maven.compiler.debug>
<!-- Quadrige3 Core version -->
<quadrige3-core.version>3.4.1</quadrige3-core.version>
<quadrige3-core.version>3.5.0</quadrige3-core.version>
<!-- Last ReefDb launcher version -->
<launcherVersion>3.0.3</launcherVersion>
......@@ -189,15 +189,9 @@
<!-- Last ReefDb db and plugin version -->
<dbVersion>2015.03.27-2</dbVersion>
<hibernate.version>4.3.9.Final</hibernate.version>
<hibernatespatial.version>4.3-20140213</hibernatespatial.version>
<hibernate-tools.version>4.3.4.Final</hibernate-tools.version>
<!-- TODO (semble fonctionner - cf Q3-dechets)
<hibernate.version>4.3.11.Final</hibernate.version>
<hibernate-tools.version>4.3.5.Final</hibernate-tools.version>
<aspectj.version>1.8.10</aspectj.version>
<spring.version>4.2.9.RELEASE</spring.version> ou+
-->
<hibernatespatial.version>4.3</hibernatespatial.version>
<hibernate-tools.version>4.3.4.Final</hibernate-tools.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
......@@ -315,7 +309,7 @@
</dependency>
<dependency>
<groupId>fr.ifremer.quadrige3</groupId>
<artifactId>quadrige3-core-client</artifactId>
<artifactId>quadrige3-ui-core-common</artifactId>
<version>${quadrige3-core.version}</version>
</dependency>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.7.0</version>
<version>3.7.1</version>
</parent>
<artifactId>reefdb-core</artifactId>
......@@ -27,7 +27,7 @@
<!--quadrige3 -->
<dependency>
<groupId>fr.ifremer.quadrige3</groupId>
<artifactId>quadrige3-core-client</artifactId>
<artifactId>quadrige3-ui-core-common</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
......@@ -60,7 +60,7 @@
<artifactId>quadrige3-test-shared</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......
......@@ -124,7 +124,7 @@ public class ReefDbProgramDaoImpl extends ProgramDaoImpl implements ReefDbProgra
cacheByCode.put(program.getCode(), program);
}
return result;
return ImmutableList.copyOf(result);
}
private void getProgramPrivileges(ProgramDTO program) {
......@@ -429,7 +429,7 @@ public class ReefDbProgramDaoImpl extends ProgramDaoImpl implements ReefDbProgra
target.setIsDepartmentHermetic(Daos.convertToString(source.isDepartmentHermetic()));
// Set update date (only if local program)
if (Daos.isLocalStatus(source.getStatus())) {
if (ReefDbBeans.isLocalStatus(source.getStatus())) {
target.setUpdateDt(newUpdateTimestamp());
}
......
......@@ -119,6 +119,15 @@ public interface ReefDbStrategyDao {
*/
DepartmentDTO getAnalysisDepartmentByAppliedStrategyId(int appliedStrategyId);
/**
* Get the unique analysis department for this applied strategy and pmfm
*
* @param appliedStrategyId the applied strategy id
* @param pmfmIds
* @return the analysis department
*/
DepartmentDTO getAnalysisDepartmentByAppliedStrategyIdAndPmfmIds(int appliedStrategyId, Collection<Integer> pmfmIds);
/**
* <p>saveStrategies.</p>
*
......
......@@ -39,11 +39,11 @@ import fr.ifremer.quadrige3.core.dao.referential.pmfm.PmfmImpl;
import fr.ifremer.quadrige3.core.dao.technical.Assert;
import fr.ifremer.quadrige3.core.dao.technical.Dates;
import fr.ifremer.quadrige3.core.dao.technical.hibernate.TemporaryDataHelper;
import fr.ifremer.quadrige3.ui.core.dto.QuadrigeBeanComparator;
import fr.ifremer.reefdb.config.ReefDbConfiguration;
import fr.ifremer.reefdb.dao.administration.user.ReefDbDepartmentDao;
import fr.ifremer.reefdb.dao.referential.pmfm.ReefDbPmfmDao;
import fr.ifremer.reefdb.dao.technical.Daos;
import fr.ifremer.reefdb.dto.ReefDbBeanComparator;
import fr.ifremer.reefdb.dto.ReefDbBeanFactory;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.configuration.programStrategy.*;
......@@ -109,7 +109,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
result.add(toStrategyDTO(Arrays.asList(row).iterator()));
}
return result;
return ImmutableList.copyOf(result);
}
......@@ -126,7 +126,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
result.add(toAppliedStrategyDTO(row));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -142,7 +142,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
result.add(toAppliedStrategyDTO(row));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -159,7 +159,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
result.add(toAppliedPeriod(row, dbTimezone));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -218,7 +218,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
result.add(previousDTO);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -238,7 +238,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
}
}
return pmfmStrategies;
return ImmutableSet.copyOf(pmfmStrategies);
}
/** {@inheritDoc} */
......@@ -277,6 +277,26 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
return departmentDao.getDepartmentById(depIds.get(0));
}
@Override
@SuppressWarnings("unchecked")
public DepartmentDTO getAnalysisDepartmentByAppliedStrategyIdAndPmfmIds(int appliedStrategyId, Collection<Integer> pmfmIds) {
Query query = createQuery("analysisDepartmentByAppliedStrategyIdAndPmfmIds",
"appliedStrategyId", IntegerType.INSTANCE, appliedStrategyId);
query.setParameterList("pmfmIds", pmfmIds);
List<Integer> depIds = (List<Integer>) query.list();
depIds = depIds.stream().filter(Objects::nonNull).collect(Collectors.toList());
if (CollectionUtils.isEmpty(depIds)) {
return null;
} else if (depIds.size() > 1) {
// the department should be unique
log.warn(String.format("More than one analysis department %s for applied strategy %s and pmfms %s", depIds, appliedStrategyId, pmfmIds));
}
return departmentDao.getDepartmentById(depIds.get(0));
}
/** {@inheritDoc} */
@Override
public void saveStrategies(ProgramDTO program) {
......@@ -373,7 +393,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
Map<String, AppliedStrategy> remainingAppliedStrategyByKey = buildAppliedStrategyMap(remainingAppliedStrategies.values(), dbTimezone);
AppliedStrategy previousAppliedStrategy = null;
// sort AppliedStrategyDTO by natural Id = monitoringLocation.Id
strategy.getAppliedStrategies().sort(new ReefDbBeanComparator());
strategy.getAppliedStrategies().sort(new QuadrigeBeanComparator());
for (AppliedStrategyDTO appliedStrategy : strategy.getAppliedStrategies()) {
// save an applied strategy only if dates are valid or department set
......@@ -836,6 +856,11 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
// then start/end date with database timezone conversion (Mantis #41597)
target.setStartDate(Dates.convertToLocalDate(Daos.convertToDate(source.next()), dbTimezone));
target.setEndDate(Dates.convertToLocalDate(Daos.convertToDate(source.next()), dbTimezone));
// set also previous dates
target.setPreviousStartDate(target.getStartDate());
target.setPreviousEndDate(target.getEndDate());
return target;
}
......@@ -923,7 +948,7 @@ public class ReefDbStrategyDaoImpl extends StrategyDaoImpl implements ReefDbStra
target.setStratDc(source.getComment());
// Set update date on strategy (only for local strategy)
if (Daos.isLocalStatus(program.getStatus())) {
if (ReefDbBeans.isLocalStatus(program.getStatus())) {
target.setUpdateDt(newUpdateTimestamp());
}
......
......@@ -23,10 +23,7 @@ package fr.ifremer.reefdb.dao.administration.user;
* #L%
*/
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.*;
import fr.ifremer.quadrige3.core.dao.administration.user.Department;
import fr.ifremer.quadrige3.core.dao.administration.user.DepartmentDaoImpl;
import fr.ifremer.quadrige3.core.dao.administration.user.DepartmentImpl;
......@@ -38,6 +35,7 @@ import fr.ifremer.quadrige3.core.dao.technical.hibernate.TemporaryDataHelper;
import fr.ifremer.quadrige3.core.service.technical.CacheService;
import fr.ifremer.reefdb.dao.technical.Daos;
import fr.ifremer.reefdb.dto.ReefDbBeanFactory;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.referential.DepartmentDTO;
import fr.ifremer.reefdb.dto.referential.PersonDTO;
import fr.ifremer.reefdb.service.StatusFilter;
......@@ -159,7 +157,7 @@ public class ReefDbDepartmentDaoImpl extends DepartmentDaoImpl implements ReefDb
}
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -215,7 +213,7 @@ public class ReefDbDepartmentDaoImpl extends DepartmentDaoImpl implements ReefDb
result.add(toDepartmentDTO(Arrays.asList(source).iterator(), true));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -227,7 +225,7 @@ public class ReefDbDepartmentDaoImpl extends DepartmentDaoImpl implements ReefDb
if (source.getStatus() == null) {
source.setStatus(Daos.getStatus(StatusCode.LOCAL_ENABLE));
}
Assert.isTrue(Daos.isLocalStatus(source.getStatus()), "source must have local status");
Assert.isTrue(ReefDbBeans.isLocalStatus(source.getStatus()), "source must have local status");
Status status = load(StatusImpl.class, source.getStatus().getCode());
......@@ -240,7 +238,7 @@ public class ReefDbDepartmentDaoImpl extends DepartmentDaoImpl implements ReefDb
target = create(target);
} else {
target = get(source.getId());
Assert.isTrue(Daos.isLocalStatus(target.getStatus()), "target must have local status");
Assert.isTrue(ReefDbBeans.isLocalStatus(target.getStatus()), "target must have local status");
Status oldStatus = target.getStatus();
target.setStatus(status);
......
......@@ -23,6 +23,7 @@ package fr.ifremer.reefdb.dao.administration.user;
* #L%
*/
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
......@@ -160,7 +161,7 @@ public class ReefDbQuserDaoImpl extends QuserDaoImpl implements ReefDbQuserDao {
result.add(target);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......
......@@ -290,7 +290,9 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
"locationId", IntegerType.INSTANCE, locationId,
"appliedStrategyId", IntegerType.INSTANCE, appliedStrategyId,
"startDate", DateType.INSTANCE, startDate,
"endDate", DateType.INSTANCE, endDate);
"endDate", DateType.INSTANCE, endDate,
"synchronizationStatusToIgnore", StringType.INSTANCE, SynchronizationStatus.DELETED.getValue()
);
}
@Override
......@@ -301,7 +303,9 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
"locationId", IntegerType.INSTANCE, locationId,
"appliedStrategyId", IntegerType.INSTANCE, appliedStrategyId,
"startDate", DateType.INSTANCE, startDate,
"endDate", DateType.INSTANCE, endDate);
"endDate", DateType.INSTANCE, endDate,
"synchronizationStatusToIgnore", StringType.INSTANCE, SynchronizationStatus.DELETED.getValue()
);
}
/** {@inheritDoc} */
......@@ -398,8 +402,8 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
Assert.notNull(bean);
Assert.notNull(bean.getLocation());
Assert.notNull(bean.getLocation().getId());
Assert.notNull(bean.getDepartment());
Assert.notNull(bean.getDepartment().getId());
Assert.notNull(bean.getRecorderDepartment());
Assert.notNull(bean.getRecorderDepartment().getId());
Assert.notNull(bean.getProgram());
Assert.notNull(bean.getProgram().getCode());
Assert.notNull(bean.getDate());
......@@ -602,8 +606,8 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
result.setLocation(monitoringLocationDao.getLocationById(locationId));
// department
Integer departmentId = (Integer) source.next();
result.setDepartment(departmentDao.getDepartmentById(departmentId));
Integer recorderDepartmentId = (Integer) source.next();
result.setRecorderDepartment(departmentDao.getDepartmentById(recorderDepartmentId));
// Apply DB timezone to survey date (Mantis #41597)
result.setDate(Dates.convertToLocalDate(Daos.convertToDate(source.next()), config.getDbTimezone()));
......@@ -618,9 +622,14 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
result.setQualificationComment((String) source.next());
result.setUpdateDate(Daos.convertToDate(source.next()));
result.setPreciseDepth(Daos.convertToDouble((Float) source.next()));
Integer depthValueId = (Integer) source.next();
if (depthValueId != null) {
result.setDepth(referentialDao.getDepthValueById(depthValueId));
// get depth value and analyst (Mantis #47991)
Measurement depthMeasurement = (Measurement) source.next();
if (depthMeasurement != null) {
if (depthMeasurement.getQualitativeValue() != null)
result.setDepth(referentialDao.getDepthValueById(depthMeasurement.getQualitativeValue().getQualValueId()));
if (depthMeasurement.getDepartment() != null)
result.setDepthAnalyst(departmentDao.getDepartmentById(depthMeasurement.getDepartment().getDepId()));
}
// program
......@@ -694,7 +703,7 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
// Recorder Department (Mantis #42615 Only if REC_DEP_ID is null)
if (entity.getRecorderDepartment() == null) {
entity.setRecorderDepartment(load(DepartmentImpl.class, bean.getDepartment().getId()));
entity.setRecorderDepartment(load(DepartmentImpl.class, bean.getRecorderDepartment().getId()));
}
// date
......@@ -764,6 +773,11 @@ public class ReefDbSurveyDaoImpl extends SurveyDaoImpl implements ReefDbSurveyDa
}
depthValue.getPrograms().addAll(entity.getPrograms());
// add analyst (Mantis #47991)
depthValue.setDepartment(bean.getDepthAnalyst() != null
? load(DepartmentImpl.class, bean.getDepthAnalyst().getId())
: null);
getSession().save(depthValue);
} else {
......
......@@ -23,10 +23,7 @@ package fr.ifremer.reefdb.dao.referential;
* #L%
*/
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.*;
import fr.ifremer.quadrige3.core.dao.referential.AnalysisInstrument;
import fr.ifremer.quadrige3.core.dao.referential.AnalysisInstrumentDaoImpl;
import fr.ifremer.quadrige3.core.dao.referential.StatusCode;
......@@ -36,6 +33,7 @@ import fr.ifremer.quadrige3.core.dao.technical.hibernate.TemporaryDataHelper;
import fr.ifremer.quadrige3.core.service.technical.CacheService;
import fr.ifremer.reefdb.dao.technical.Daos;
import fr.ifremer.reefdb.dto.ReefDbBeanFactory;
import fr.ifremer.reefdb.dto.ReefDbBeans;
import fr.ifremer.reefdb.dto.referential.AnalysisInstrumentDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.hibernate.Query;
......@@ -102,7 +100,7 @@ public class ReefDbAnalysisInstrumentDaoImpl extends AnalysisInstrumentDaoImpl i
cacheById.put(analysisInstrument.getId(), analysisInstrument);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -120,7 +118,7 @@ public class ReefDbAnalysisInstrumentDaoImpl extends AnalysisInstrumentDaoImpl i
result.add(toAnalysisInstrumentDTO(Arrays.asList(source).iterator()));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -137,7 +135,7 @@ public class ReefDbAnalysisInstrumentDaoImpl extends AnalysisInstrumentDaoImpl i
result.add(toAnalysisInstrumentDTO(Arrays.asList(source).iterator()));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -251,7 +249,7 @@ public class ReefDbAnalysisInstrumentDaoImpl extends AnalysisInstrumentDaoImpl i
if (analysisInstrument.getStatus() == null) {
analysisInstrument.setStatus(Daos.getStatus(StatusCode.LOCAL_ENABLE));
}
Assert.isTrue(Daos.isLocalStatus(analysisInstrument.getStatus()), "source must have local status");
Assert.isTrue(ReefDbBeans.isLocalStatus(analysisInstrument.getStatus()), "source must have local status");
AnalysisInstrument target;
if (analysisInstrument.getId() == null) {
......@@ -259,7 +257,7 @@ public class ReefDbAnalysisInstrumentDaoImpl extends AnalysisInstrumentDaoImpl i
target.setAnalInstId(TemporaryDataHelper.getNewNegativeIdForTemporaryData(getSession(), target.getClass()));
} else {
target = get(analysisInstrument.getId());
Assert.isTrue(Daos.isLocalStatus(target.getStatus()), "target must have local status");
Assert.isTrue(ReefDbBeans.isLocalStatus(target.getStatus()), "target must have local status");
}
target.setAnalInstNm(analysisInstrument.getName());
......
......@@ -23,6 +23,7 @@ package fr.ifremer.reefdb.dao.referential;
* #L%
*/
import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
import fr.ifremer.reefdb.dto.referential.*;
import org.springframework.cache.annotation.Cacheable;
......@@ -148,7 +149,7 @@ public interface ReefDbReferentialDao {
* @return a {@link java.util.List} object.
*/
@Cacheable(value = "all_citations")
List<BaseReferentialDTO> getAllCitations();
List<CitationDTO> getAllCitations();
/**
* <p>getAllPhotoTypes.</p>
......
......@@ -23,11 +23,13 @@ package fr.ifremer.reefdb.dao.referential;
* #L%
*/
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import fr.ifremer.quadrige3.core.dao.referential.StatusCode;
import fr.ifremer.quadrige3.core.dao.technical.Assert;
import fr.ifremer.quadrige3.core.dao.technical.hibernate.HibernateDaoSupport;
import fr.ifremer.quadrige3.core.service.technical.CacheService;
import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
import fr.ifremer.reefdb.config.ReefDbConfiguration;
import fr.ifremer.reefdb.dao.referential.pmfm.ReefDbPmfmDao;
import fr.ifremer.reefdb.dao.technical.Daos;
......@@ -103,7 +105,7 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
cacheById.put(depthLevel.getId(), depthLevel);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -146,7 +148,7 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
values = pmfm.getQualitativeValues();
}
return ReefDbBeans.transformCollection(values,
return ImmutableList.copyOf(ReefDbBeans.transformCollection(values,
input -> {
DepthDTO result = ReefDbBeanFactory.newDepthDTO();
result.setId(input.getId());
......@@ -155,7 +157,7 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
// add to cache
cacheById.put(result.getId(), result);
return result;
});
}));
}
......@@ -222,7 +224,7 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
cacheByCode.put(qualityFlag.getCode(), qualityFlag);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -273,7 +275,7 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
cacheById.put(positioningSystem.getId(), positioningSystem);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -299,12 +301,12 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
Object[] source = it.next();
GroupingTypeDTO groupingType = toGroupingTypeDTO(Arrays.asList(source).iterator());
groupingType.setGrouping(getGroupingsByType(groupingType.getCode()));
groupingType.setGrouping(new ArrayList<>(getGroupingsByType(groupingType.getCode())));
result.add(groupingType);
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -318,21 +320,21 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
result.add(toGroupingDTO(Arrays.asList(source).iterator()));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
@Override
public List<BaseReferentialDTO> getAllCitations() {
public List<CitationDTO> getAllCitations() {
Iterator<Object[]> it = queryIterator("allCitations");
List<BaseReferentialDTO> result = Lists.newArrayList();
List<CitationDTO> result = Lists.newArrayList();
while (it.hasNext()) {
Object[] source = it.next();
result.add(toBaseReferentialDTO(Arrays.asList(source).iterator()));
result.add(toCitationDTO(Arrays.asList(source).iterator()));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -347,7 +349,7 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
result.add(toPhotoTypeDTO(Arrays.asList(source).iterator()));
}
return result;
return ImmutableList.copyOf(result);
}
/** {@inheritDoc} */
......@@ -414,11 +416,10 @@ public class ReefDbReferentialDaoImpl extends HibernateDaoSupport implements Ree
return result;
}
private BaseReferentialDTO toBaseReferentialDTO(Iterator<Object> source) {
BaseReferentialDTO result = ReefDbBeanFactory.newBaseReferentialDTO();
private CitationDTO toCitationDTO(Iterator<Object> source) {
CitationDTO result = ReefDbBeanFactory.newCitationDTO();
result.setId((Integer) source.next());
result.setName((String) source.next());
return result;
}