branch support/3.13.x updated (d529891 -> 514d906)
This is an automated email from the git hooks/post-receive script. New change to branch support/3.13.x in repository tutti. See http://git.codelutin.com/tutti.git from d529891 set version to snapshots new 514d906 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 514d9060443e140bc9059acb70d70244e661616a 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 support/3.13.x in repository tutti. See http://git.codelutin.com/tutti.git commit 514d9060443e140bc9059acb70d70244e661616a 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 60a01cc..d18f3bb 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 @@ -115,26 +115,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