branch support/3.13.x updated (f842397 -> edc9cd2)
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 discards f842397 refs #6886: ajout d'une exception lors qu'un taxon ne peut être chargé new edc9cd2 fixes #6886: ajout d'une exception lors qu'un taxon ne peut être chargé This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (f842397) \ N -- N -- N refs/heads/support/3.13.x (edc9cd2) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. 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 edc9cd2df7956176ad4fe968e3ed74f13fcc9e83 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Apr 2 08:44:02 2015 +0200 fixes #6886: ajout d'une exception lors qu'un taxon ne peut être chargé Summary of changes: -- 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 edc9cd2df7956176ad4fe968e3ed74f13fcc9e83 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Apr 2 08:44:02 2015 +0200 fixes #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