Commit 3f83ed2a authored by COTONNEC's avatar COTONNEC
Browse files

[enh] Allow to add taxon name details form app

parent 6d5da400
......@@ -87,6 +87,8 @@ public class CacheConfiguration extends CachingConfigurerSupport {
String PMFM_STRATEGIES_BY_FILTER = "net.sumaris.core.dao.administration.programStrategy.pmfmStrategiesByFilter";
String DENORMALIZED_PMFM_BY_FILTER = "net.sumaris.core.dao.administration.programStrategy.denormalizedPmfmByFilter";
String TAXON_NAME_BY_ID = "net.sumaris.core.dao.referential.taxonNameById";
String TAXON_NAME_BY_FILTER = "net.sumaris.core.dao.referential.taxonNameByFilter";
String TAXON_NAME_BY_TAXON_REFERENCE_ID = "net.sumaris.core.dao.referential.taxonNameByReferenceId";
String TAXON_NAMES_BY_TAXON_GROUP_ID = "net.sumaris.core.dao.referential.taxonNamesByTaxonGroupId";
String REFERENCE_TAXON_ID_BY_TAXON_NAME_ID = "net.sumaris.core.dao.referential.referenceTaxonIdByTaxonNameId";
......@@ -133,6 +135,8 @@ public class CacheConfiguration extends CachingConfigurerSupport {
Caches.createEternalHeapCache(cacheManager, Names.PMFM_HAS_SUFFIX, Boolean.class, 600);
Caches.createEternalHeapCache(cacheManager, Names.PMFM_HAS_MATRIX, Boolean.class, 600);
Caches.createEternalHeapCache(cacheManager, Names.TAXON_NAME_BY_TAXON_REFERENCE_ID, Integer.class, TaxonNameVO.class, 600);
Caches.createEternalHeapCache(cacheManager, Names.TAXON_NAME_BY_ID, Integer.class, TaxonNameVO.class, 600);
Caches.createEternalHeapCache(cacheManager, Names.TAXON_NAME_BY_FILTER, Integer.class, TaxonNameVO.class, 600);
Caches.createEternalCollectionHeapCache(cacheManager, Names.TAXON_NAMES_BY_TAXON_GROUP_ID, Integer.class, TaxonNameVO.class, 600);
Caches.createEternalHeapCache(cacheManager, Names.REFERENCE_TAXON_ID_BY_TAXON_NAME_ID, Integer.class, Integer.class, 600);
Caches.createEternalCollectionHeapCache(cacheManager, Names.REFERENTIAL_TYPES, ReferentialTypeVO.class, 600);
......
......@@ -33,6 +33,7 @@ import net.sumaris.core.dao.referential.ReferentialRepositoryImpl;
import net.sumaris.core.dao.referential.location.LocationRepository;
import net.sumaris.core.dao.referential.pmfm.PmfmRepository;
import net.sumaris.core.dao.referential.taxon.TaxonNameRepository;
import net.sumaris.core.dao.referential.taxon.TaxonNameRepositoryImpl;
import net.sumaris.core.dao.technical.jpa.BindableSpecification;
import net.sumaris.core.exception.NotUniqueException;
import net.sumaris.core.exception.SumarisTechnicalException;
......@@ -125,7 +126,6 @@ public class StrategyRepositoryImpl
public StrategyVO save(StrategyVO vo) {
Preconditions.checkNotNull(vo);
Preconditions.checkNotNull(vo.getProgramId(), "Missing 'programId'");
Preconditions.checkNotNull(vo.getLabel(), "Missing 'label'");
Preconditions.checkNotNull(vo.getName(), "Missing 'name'");
Preconditions.checkNotNull(vo.getStatusId(), "Missing 'statusId'");
......@@ -494,10 +494,16 @@ public class StrategyRepositoryImpl
Map<Integer, ReferenceTaxonStrategy> sourcesToRemove = Beans.splitByProperty(parent.getReferenceTaxons(),
ReferenceTaxonStrategy.Fields.REFERENCE_TAXON + "." + ReferenceTaxon.Fields.ID);
TaxonNameRepositoryImpl tnr = new TaxonNameRepositoryImpl(em);
// Save each reference taxon strategy
Beans.getStream(sources).forEach(source -> {
Integer referenceTaxonId = source.getReferenceTaxonId() != null ? source.getReferenceTaxonId() :
(source.getTaxonName() != null ? source.getTaxonName().getReferenceTaxonId() : null);
if (referenceTaxonId == null) {
referenceTaxonId = tnr.getReferenceTaxonIdById(source.getTaxonName().getId());
}
if (referenceTaxonId == null) throw new DataIntegrityViolationException("Missing referenceTaxon.id in a ReferenceTaxonStrategyVO");
ReferenceTaxonStrategy target = sourcesToRemove.remove(referenceTaxonId);
boolean isNew = target == null;
......
package net.sumaris.core.dao.referential.taxon;
/*-
* #%L
* SUMARiS:: Core
* %%
* Copyright (C) 2018 SUMARiS Consortium
* %%
* 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 net.sumaris.core.model.referential.taxon.ReferenceTaxon;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ReferenceTaxonRepository extends JpaRepository<ReferenceTaxon, Integer> {
ReferenceTaxon save(ReferenceTaxon referenceTaxon);
}
......@@ -10,12 +10,12 @@ package net.sumaris.core.dao.referential.taxon;
* 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>.
......@@ -24,15 +24,24 @@ package net.sumaris.core.dao.referential.taxon;
import com.google.common.base.Preconditions;
import lombok.extern.slf4j.Slf4j;
import net.sumaris.core.config.CacheConfiguration;
import net.sumaris.core.dao.referential.ReferentialDao;
import net.sumaris.core.dao.referential.ReferentialRepositoryImpl;
import net.sumaris.core.dao.technical.Daos;
import net.sumaris.core.dao.technical.Pageables;
import net.sumaris.core.dao.technical.SortDirection;
import net.sumaris.core.model.referential.StatusEnum;
import net.sumaris.core.model.referential.taxon.ReferenceTaxon;
import net.sumaris.core.model.referential.taxon.TaxonName;
import net.sumaris.core.model.referential.taxon.TaxonomicLevel;
import net.sumaris.core.model.referential.taxon.TaxonomicLevelEnum;
import net.sumaris.core.vo.filter.TaxonNameFilterVO;
import net.sumaris.core.vo.referential.ReferentialFetchOptions;
import net.sumaris.core.vo.referential.TaxonNameVO;
import net.sumaris.core.vo.referential.*;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
......@@ -47,13 +56,22 @@ import java.util.stream.Collectors;
*/
@Slf4j
public class TaxonNameRepositoryImpl
extends ReferentialRepositoryImpl<TaxonName, TaxonNameVO, TaxonNameFilterVO, ReferentialFetchOptions>
implements TaxonNameSpecifications {
extends ReferentialRepositoryImpl<TaxonName, TaxonNameVO, TaxonNameFilterVO, ReferentialFetchOptions>
implements TaxonNameSpecifications {
@Autowired
private ReferentialDao referentialDao;
public TaxonNameRepositoryImpl(EntityManager entityManager) {
super(TaxonName.class, TaxonNameVO.class, entityManager);
}
@Override
@Cacheable(cacheNames = CacheConfiguration.Names.TAXON_NAME_BY_ID, key = "#id")
public TaxonNameVO get(int id) {
return super.get(id);
}
@Override
public List<TaxonNameVO> findByFilter(TaxonNameFilterVO filter, int offset, int size, String sortAttribute, SortDirection sortDirection) {
return findByFilter(filter, Pageables.create(offset, size, sortAttribute, sortDirection));
......@@ -63,24 +81,23 @@ public class TaxonNameRepositoryImpl
public List<TaxonNameVO> getAll(boolean withSynonyms) {
return findByFilter(
TaxonNameFilterVO.builder()
.withSynonyms(withSynonyms)
.levelIds(new Integer[]{TaxonomicLevelEnum.SPECIES.getId(), TaxonomicLevelEnum.SUBSPECIES.getId()})
.build(),
Pageable.unpaged()
TaxonNameFilterVO.builder()
.withSynonyms(withSynonyms)
.levelIds(new Integer[]{TaxonomicLevelEnum.SPECIES.getId(), TaxonomicLevelEnum.SUBSPECIES.getId()})
.build(),
Pageable.unpaged()
);
}
@Override
public Optional<TaxonNameVO> findReferentByReferenceTaxonId(int referenceTaxonId) {
List<TaxonNameVO> taxonNames = findByFilter(
TaxonNameFilterVO.builder()
.referenceTaxonId(referenceTaxonId)
.withSynonyms(false)
.build(),
Pageable.unpaged()
TaxonNameFilterVO.builder()
.referenceTaxonId(referenceTaxonId)
.withSynonyms(false)
.build(),
Pageable.unpaged()
);
if (CollectionUtils.isEmpty(taxonNames)) return Optional.empty();
if (taxonNames.size() > 1) {
......@@ -93,12 +110,12 @@ public class TaxonNameRepositoryImpl
public List<TaxonNameVO> getAllByTaxonGroupId(int taxonGroupId) {
return findByFilter(
TaxonNameFilterVO.builder()
.levelIds(new Integer[]{TaxonomicLevelEnum.SPECIES.getId(), TaxonomicLevelEnum.SUBSPECIES.getId()})
.taxonGroupId(taxonGroupId)
.withSynonyms(false)
.build(),
Pageable.unpaged()
TaxonNameFilterVO.builder()
.levelIds(new Integer[]{TaxonomicLevelEnum.SPECIES.getId(), TaxonomicLevelEnum.SUBSPECIES.getId()})
.taxonGroupId(taxonGroupId)
.withSynonyms(false)
.build(),
Pageable.unpaged()
);
}
......@@ -106,11 +123,26 @@ public class TaxonNameRepositoryImpl
protected Specification<TaxonName> toSpecification(TaxonNameFilterVO filter, ReferentialFetchOptions fetchOptions) {
return super.toSpecification(filter, fetchOptions)
.and(withTaxonGroupId(filter.getTaxonGroupId()))
.and(withTaxonGroupIds(filter.getTaxonGroupIds()))
.and(withSynonyms(filter.getWithSynonyms()))
.and(withReferenceTaxonId(filter.getReferenceTaxonId()))
.and(inLevelIds(TaxonName.class, filter.getLevelIds()));
.and(withTaxonGroupId(filter.getTaxonGroupId()))
.and(withTaxonGroupIds(filter.getTaxonGroupIds()))
.and(withSynonyms(filter.getWithSynonyms()))
.and(withReferenceTaxonId(filter.getReferenceTaxonId()))
.and(inLevelIds(TaxonName.class, filter.getLevelIds()));
}
@Override
public void toEntity(TaxonNameVO source, TaxonName target, boolean copyIfNull) {
super.toEntity(source, target, copyIfNull);
target.setReferent(source.getIsReferent());
target.setVirtual(source.getIsVirtual());
target.setNaming(source.getIsNaming());
// Link to other entities
Daos.setEntityProperties(getEntityManager(), target,
TaxonName.Fields.PARENT, TaxonName.class, source.getParentId(),
TaxonName.Fields.TAXONOMIC_LEVEL, TaxonomicLevel.class, source.getTaxonomicLevelId(),
TaxonName.Fields.REFERENCE_TAXON, ReferenceTaxon.class, source.getReferenceTaxonId());
}
@Override
......@@ -119,7 +151,14 @@ public class TaxonNameRepositoryImpl
if (source.getReferenceTaxon() != null) {
target.setReferenceTaxonId(source.getReferenceTaxon().getId());
target.setIsReferent(source.isReferent());
}
if (source.getParent() != null) {
target.setParentTaxonName(this.toVO(source.getParent()));
}
if (source.getTaxonomicLevel() != null) {
target.setTaxonomicLevel(referentialDao.toVO(source.getTaxonomicLevel()));
}
return target;
......@@ -133,15 +172,15 @@ public class TaxonNameRepositoryImpl
TypedQuery<TaxonName> query = getQuery(toSpecification(filter), pageable);
if (pageable.isPaged()) {
query.setFirstResult((int)pageable.getOffset()).setMaxResults(pageable.getPageSize());
query.setFirstResult((int) pageable.getOffset()).setMaxResults(pageable.getPageSize());
}
return query.getResultStream()
.map(this::toVO)
.collect(Collectors.toList());
.map(this::toVO)
.collect(Collectors.toList());
}
@Override
@Override
public Integer getReferenceTaxonIdById(int id) {
return getEntityManager()
.createNamedQuery("TaxonName.referenceTaxonIdById", Integer.class)
......@@ -158,10 +197,45 @@ public class TaxonNameRepositoryImpl
target.setIsNaming(source.isNaming());
target.setIsVirtual(source.isVirtual());
// Reference taxon id
target.setReferenceTaxonId(source.getReferenceTaxon().getId());
// Reference taxon id
if (source.getReferenceTaxon() != null) {
target.setReferenceTaxonId(source.getReferenceTaxon().getId());
}
// Taxonomic level id
target.setTaxonomicLevelId(source.getTaxonomicLevel().getId());
if (source.getTaxonomicLevel() != null) {
target.setTaxonomicLevel(referentialDao.toVO(source.getTaxonomicLevel()));
target.setTaxonomicLevelId(source.getTaxonomicLevel().getId());
}
if (source.getParent() != null) {
target.setParentTaxonName(this.toVO(source.getParent()));
target.setParentId(source.getParent().getId());
}
}
@Override
@Caching(
evict = {
@CacheEvict(cacheNames = CacheConfiguration.Names.TAXON_NAME_BY_ID, key = "#vo.id", condition = "#vo.id != null"),
@CacheEvict(cacheNames = CacheConfiguration.Names.TAXON_NAME_BY_FILTER, allEntries = true)
}
)
public TaxonNameVO save(TaxonNameVO vo) {
Preconditions.checkNotNull(vo);
Preconditions.checkNotNull(vo.getReferenceTaxonId(), "Missing 'ReferenceTaxonId'");
Preconditions.checkNotNull(vo.getTaxonomicLevelId(), "Missing 'TaxonomicLevelId'");
Preconditions.checkNotNull(vo.getName(), "Missing 'name'");
Preconditions.checkNotNull(vo.getStatusId(), "Missing 'statusId'");
Preconditions.checkNotNull(vo.getIsNaming(), "Missing 'IsNaming'");
Preconditions.checkNotNull(vo.getIsReferent(), "Missing 'IsReferent'");
Preconditions.checkNotNull(vo.getIsVirtual(), "Missing 'IsVirtual'");
if (vo.getId() == null && vo.getStatusId() == null)
// Set default status to Temporary
vo.setStatusId(StatusEnum.TEMPORARY.getId());
TaxonNameVO savedVo = super.save(vo);
return savedVo;
}
}
......@@ -10,12 +10,12 @@ package net.sumaris.core.service.referential.taxon;
* 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>.
......@@ -27,12 +27,17 @@ import net.sumaris.core.vo.filter.TaxonNameFilterVO;
import net.sumaris.core.vo.referential.TaxonNameVO;
import org.springframework.transaction.annotation.Transactional;
import java.io.PrintStream;
import java.util.List;
@Transactional
public interface TaxonNameService {
@Transactional(readOnly = true)
TaxonNameVO get(int id);
@Transactional(readOnly = true)
TaxonNameVO getByLabel(String label);
@Transactional(readOnly = true)
List<TaxonNameVO> findByFilter(TaxonNameFilterVO filter, int offset, int size, String sortAttribute, SortDirection sortDirection);
......@@ -41,4 +46,7 @@ public interface TaxonNameService {
@Transactional(readOnly = true)
List<TaxonNameVO> getAllByTaxonGroupId(Integer taxonGroupId);
TaxonNameVO save(TaxonNameVO taxonName);
}
......@@ -10,21 +10,24 @@ package net.sumaris.core.service.referential.taxon;
* 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.base.Preconditions;
import lombok.extern.slf4j.Slf4j;
import net.sumaris.core.dao.referential.taxon.ReferenceTaxonRepository;
import net.sumaris.core.dao.referential.taxon.TaxonNameRepository;
import net.sumaris.core.dao.technical.SortDirection;
import net.sumaris.core.model.referential.taxon.ReferenceTaxon;
import net.sumaris.core.vo.filter.TaxonNameFilterVO;
import net.sumaris.core.vo.referential.TaxonNameVO;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,6 +42,20 @@ public class TaxonNameServiceImpl implements TaxonNameService {
@Autowired
protected TaxonNameRepository taxonNameRepository;
@Autowired
protected ReferenceTaxonRepository referenceTaxonRepository;
@Override
public TaxonNameVO get(int id) {
return taxonNameRepository.get(id);
}
@Override
public TaxonNameVO getByLabel(String label) {
Preconditions.checkNotNull(label);
return taxonNameRepository.getByLabel(label);
}
@Override
public List<TaxonNameVO> findByFilter(TaxonNameFilterVO filter, int offset, int size, String sortAttribute, SortDirection sortDirection) {
return taxonNameRepository.findByFilter(filter, offset, size, sortAttribute, sortDirection);
......@@ -53,4 +70,19 @@ public class TaxonNameServiceImpl implements TaxonNameService {
public List<TaxonNameVO> getAllByTaxonGroupId(Integer taxonGroupId) {
return taxonNameRepository.getAllByTaxonGroupId(taxonGroupId);
}
@Override
public TaxonNameVO save(TaxonNameVO source) {
Preconditions.checkNotNull(source);
if (source.getReferenceTaxonId() == null){
source.setReferenceTaxonId(referenceTaxonRepository.save(new ReferenceTaxon()).getId());
}
// else{
// List<TaxonNameVO> taxonNameReferents = taxonNameRepository.
// }
return taxonNameRepository.save(source);
}
}
/*
* #%L
* SUMARiS
* %%
* Copyright (C) 2019 SUMARiS Consortium
* %%
* 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%
*/
package net.sumaris.core.vo.referential;
import lombok.Data;
import net.sumaris.core.dao.technical.model.IUpdateDateEntityBean;
import net.sumaris.core.dao.technical.model.IValueObject;
import java.util.Date;
@Data
public class ReferenceTaxonVO implements IValueObject<Integer>,
IUpdateDateEntityBean<Integer, Date> {
private Integer id;
private Date updateDate;
}
......@@ -31,11 +31,9 @@ import java.util.Date;
@Data
@FieldNameConstants
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
@EqualsAndHashCode(callSuper = true)
public class TaxonNameVO extends ReferentialVO {
private Integer referenceTaxonId;
private String completeName;
private Date startDate;
private Date endDate;
......@@ -45,7 +43,12 @@ public class TaxonNameVO extends ReferentialVO {
private Boolean isVirtual;
private Integer upperRank;
private Integer referenceTaxonId;
private Integer taxonomicLevelId;
private Integer parentId;
private ReferentialVO taxonomicLevel;
private TaxonNameVO parentTaxonName;
public TaxonNameVO() {
this.setEntityName(TaxonName.class.getSimpleName()); // Need by client (e.f. GraphQL cache)
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"
logicalFilePath="https://github.com/sumaris-net/sumaris-pod/blob/master/sumaris-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/sumaris/db-changelog-1.4.6.xml">
<property name="sqlCheck.empty.sql" value="SELECT count(*) FROM STATUS"/>
<property name="sqlCheck.sumaris.sql" value="SELECT COUNT(*) FROM PROGRAM WHERE LABEL = 'SUMARiS'"/>
<property name="sqlCheck.sumaris.expectedResult" value="1"/>
<preConditions onFail="WARN" onFailMessage="Database instance is not a SUMARiS database instance ! Do not include this changelog file in the master file">
<or>
<!-- Test if database is empty -->
<sqlCheck expectedResult="0">${sqlCheck.empty.sql}</sqlCheck>
<!-- OR if expected production database -->
<sqlCheck expectedResult="${sqlCheck.sumaris.expectedResult}">${sqlCheck.sumaris.sql}</sqlCheck>
</or>
</preConditions>
<!-- Insert REFERENCE_TAXON -->
<changeSet author="benoit.lavenier@e-is.pro" id="1603121052996-305" runOnChange="true">
<preConditions onFail="MARK_RAN">
<and>
<sqlCheck expectedResult="${sqlCheck.sumaris.expectedResult}">${sqlCheck.sumaris.sql}</sqlCheck>
<sqlCheck expectedResult="0">SELECT count(*) FROM REFERENCE_TAXON where ID IN (1062, 1063)</sqlCheck>
</and>
</preConditions>
<insert tableName="REFERENCE_TAXON">
<column name="ID" valueNumeric="1062"/>
<column name="UPDATE_DATE" valueComputed="current_timestamp"/>
</insert>
<insert tableName="REFERENCE_TAXON">
<column name="ID" valueNumeric="1063"/>
<column name="UPDATE_DATE" valueComputed="current_timestamp"/>
</insert>
</changeSet>
<!-- Insert TAXON_NAME -->
<changeSet author="benoit.lavenier@e-is.pro" id="1603121052996-305" runOnChange="true">
<preConditions onFail="MARK_RAN">
<and>
<sqlCheck expectedResult="${sqlCheck.sumaris.expectedResult}">${sqlCheck.sumaris.sql}</sqlCheck>
<sqlCheck expectedResult="0">SELECT count(*) FROM TAXON_NAME where ID IN (1062, 1063)</sqlCheck>
</and>
</preConditions>
<insert tableName="TAXON_NAME">
<column name="ID" valueNumeric="1062"/>
<column name="CREATION_DATE" valueComputed="current_timestamp"/>
<column name="IS_NAMING" valueBoolean="false"/>
<column name="IS_REFERENT" valueBoolean="true"/>
<column name="IS_VIRTUAL" valueBoolean="false"/>
<column name="LABEL" valueBoolean="LBS"/>
<column name="NAME" value="Homarus"/>
<column name="START_DATE" valueComputed="current_timestamp"/>
<column name="PARENT_TAXON_NAME_FK" valueNumeric="1041"/>
<column name="REFERENCE_TAXON_FK" valueNumeric="1062"/>
<column name="STATUS_FK" valueBoolean="1"/>
<column name="TAXONOMIC_LEVEL" valueNumeric="28" />
</insert>
<insert tableName="TAXON_NAME">
<column name="ID" valueNumeric="1063"/>
<column name="CREATION_DATE" valueComputed="current_timestamp"/>
<column name="IS_NAMING" valueBoolean="false"/>
<column name="IS_REFERENT" valueBoolean="true"/>
<column name="IS_VIRTUAL" valueBoolean="false"/>
<column name="LABEL" valueBoolean="LBE"/>
<column name="NAME" value="Homarus Gammarus"/>
<column name="START_DATE" valueComputed="current_timestamp"/>
<column name="PARENT_TAXON_NAME_FK" valueNumeric="1062"/>
<column name="REFERENCE_TAXON_FK" valueNumeric="1063"/>