Mercurial > lada > lada-server
changeset 84:74a488e52dde
Moved errors and warnings from LProbeRepository to Repository as they are
needed in other places too.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Fri, 07 Jun 2013 14:40:06 +0200 |
parents | e7c4ae4b5eba |
children | 7b932d54719c |
files | src/main/java/de/intevation/lada/data/LProbeRepository.java src/main/java/de/intevation/lada/data/Repository.java |
diffstat | 2 files changed, 62 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LProbeRepository.java Fri Jun 07 14:34:46 2013 +0200 +++ b/src/main/java/de/intevation/lada/data/LProbeRepository.java Fri Jun 07 14:40:06 2013 +0200 @@ -41,13 +41,6 @@ private LProbeManager manager; /** - * Errors/Warnings occured in repository operations. - */ - private int generalError; - private Map<String, Integer> errors; - private Map<String, Integer> warnings; - - /** * Filter for LProbe objects. * * @param mstId mst_id @@ -125,57 +118,4 @@ return false; } - /** - * Getter for the error code returned by the validator. - * - * @return The error code returned by the validator. - */ - public int getGeneralError() { - return generalError; - } - - /** - * Private setter for the general error code. - * - * @param generalError - */ - private void setGeneralError(int generalError) { - this.generalError = generalError; - } - - /** - * Getter for all errors occured while validating a LProbe object. - * - * @return Map of field - error code pairs. - */ - public Map<String, Integer> getErrors() { - return errors; - } - - /** - * Private setter for validation errors. - * - * @param errors - */ - private void setErrors(Map<String, Integer> errors) { - this.errors = errors; - } - - /** - * Getter for all warnings occured while validating a LProbe object. - * - * @return Map of field - error code pairs. - */ - public Map<String, Integer> getWarnings() { - return warnings; - } - - /** - * Private setter for validation warnings. - * - * @param warnings - */ - private void setWarnings(Map<String, Integer> warnings) { - this.warnings = warnings; - } }
--- a/src/main/java/de/intevation/lada/data/Repository.java Fri Jun 07 14:34:46 2013 +0200 +++ b/src/main/java/de/intevation/lada/data/Repository.java Fri Jun 07 14:40:06 2013 +0200 @@ -1,6 +1,7 @@ package de.intevation.lada.data; import java.util.List; +import java.util.Map; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; @@ -27,6 +28,13 @@ private EntityManager em; /** + * Errors/Warnings occured in repository operations. + */ + private int generalError; + private Map<String, Integer> errors; + private Map<String, Integer> warnings; + + /** * Get all objects of type <link>clazz</link>from database. * * @param clazz The class type. @@ -50,4 +58,58 @@ public <T> T findById(Class<T> clazz, String id) { return em.find(clazz, id); } + + /** + * Getter for the error code returned by the validator. + * + * @return The error code returned by the validator. + */ + public int getGeneralError() { + return generalError; + } + + /** + * Protected setter for the general error code. + * + * @param generalError + */ + protected void setGeneralError(int generalError) { + this.generalError = generalError; + } + + /** + * Getter for all errors occured while validating a LProbe object. + * + * @return Map of field - error code pairs. + */ + public Map<String, Integer> getErrors() { + return errors; + } + + /** + * Protected setter for validation errors. + * + * @param errors + */ + protected void setErrors(Map<String, Integer> errors) { + this.errors = errors; + } + + /** + * Getter for all warnings occured while validating a LProbe object. + * + * @return Map of field - error code pairs. + */ + public Map<String, Integer> getWarnings() { + return warnings; + } + + /** + * Protected setter for validation warnings. + * + * @param warnings + */ + protected void setWarnings(Map<String, Integer> warnings) { + this.warnings = warnings; + } }