branch develop updated (7dedfd4 -> 5951a67)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository tutti. See http://git.codelutin.com/tutti.git from 7dedfd4 fixes #6698: [IMPORT GENERIQUE] Rapport d’import transmissible par mail Merge branch 'feature/6698' into develop new 5951a67 refs #6886: ajout d'une exception lors qu'un taxon ne peut être chargé The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 5951a67e45b90472a27f432800f1a096f0cac7a7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Apr 2 08:44:02 2015 +0200 refs #6886: ajout d'une exception lors qu'un taxon ne peut être chargé Summary of changes: .../referential/CouldNotLoadTaxonException.java | 26 +++++++++++++++++ .../referential/SpeciesPersistenceServiceImpl.java | 34 +++++++++++++--------- 2 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CouldNotLoadTaxonException.java -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 5951a67e45b90472a27f432800f1a096f0cac7a7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Apr 2 08:44:02 2015 +0200 refs #6886: ajout d'une exception lors qu'un taxon ne peut être chargé --- .../referential/CouldNotLoadTaxonException.java | 26 +++++++++++++++++ .../referential/SpeciesPersistenceServiceImpl.java | 34 +++++++++++++--------- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CouldNotLoadTaxonException.java b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CouldNotLoadTaxonException.java new file mode 100644 index 0000000..19a78e2 --- /dev/null +++ b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/CouldNotLoadTaxonException.java @@ -0,0 +1,26 @@ +package fr.ifremer.tutti.persistence.service.referential; + +import org.nuiton.jaxx.application.ApplicationTechnicalException; + +/** + * Created on 4/2/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.13.7 + */ +public class CouldNotLoadTaxonException extends ApplicationTechnicalException { + + private static final long serialVersionUID = 1L; + + private final Integer referenceTaxonId; + + public CouldNotLoadTaxonException(Integer referenceTaxonId, String message, Throwable cause) { + super(message, cause); + this.referenceTaxonId = referenceTaxonId; + } + + public Integer getReferenceTaxonId() { + return referenceTaxonId; + } + +} diff --git a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/SpeciesPersistenceServiceImpl.java b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/SpeciesPersistenceServiceImpl.java index 880c4f1..e747ed9 100644 --- a/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/SpeciesPersistenceServiceImpl.java +++ b/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/referential/SpeciesPersistenceServiceImpl.java @@ -121,26 +121,34 @@ public class SpeciesPersistenceServiceImpl extends ReferentialPersistenceService @Override public Species getSpeciesByReferenceTaxonId(Integer referenceTaxonId) { - Species result = getSpeciesByReferenceTaxonId( - referenceTaxonId, - TranscribingItemTypeId.TAXON_NAME_REFTAX_CODE.getValue()); - if (result != null) { - result.setRefTaxCode(result.getExternalCode()); + try { + Species result = getSpeciesByReferenceTaxonId( + referenceTaxonId, + TranscribingItemTypeId.TAXON_NAME_REFTAX_CODE.getValue()); + if (result != null) { + result.setRefTaxCode(result.getExternalCode()); + } + return result; + } catch (Exception e) { + throw new CouldNotLoadTaxonException(referenceTaxonId, "Could not getSpeciesByReferenceTaxonId with referenceTaxonId: " + referenceTaxonId, e); } - return result; - } @Override public Species getSpeciesByReferenceTaxonIdWithVernacularCode(Integer referenceTaxonId) { - Species result = getSpeciesByReferenceTaxonId( - referenceTaxonId, - TranscribingItemTypeId.TAXON_NAME_LOCAL_NAME.getValue()); - if (result != null) { - result.setVernacularCode(result.getExternalCode()); + try { + Species result = getSpeciesByReferenceTaxonId( + referenceTaxonId, + TranscribingItemTypeId.TAXON_NAME_LOCAL_NAME.getValue()); + if (result != null) { + result.setVernacularCode(result.getExternalCode()); + } + return result; + } catch (Exception e) { + throw new CouldNotLoadTaxonException(referenceTaxonId, "Could not getSpeciesByReferenceTaxonId with referenceTaxonId: " + referenceTaxonId, e); } - return result; + } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm