# HG changeset patch # User Torsten Irländer # Date 1370608806 -7200 # Node ID 74a488e52dde47307abacf583525e34a9406d114 # Parent e7c4ae4b5ebab129931cbf4078f20e3e05d12a8b Moved errors and warnings from LProbeRepository to Repository as they are needed in other places too. diff -r e7c4ae4b5eba -r 74a488e52dde src/main/java/de/intevation/lada/data/LProbeRepository.java --- 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 errors; - private Map 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 getErrors() { - return errors; - } - - /** - * Private setter for validation errors. - * - * @param errors - */ - private void setErrors(Map errors) { - this.errors = errors; - } - - /** - * Getter for all warnings occured while validating a LProbe object. - * - * @return Map of field - error code pairs. - */ - public Map getWarnings() { - return warnings; - } - - /** - * Private setter for validation warnings. - * - * @param warnings - */ - private void setWarnings(Map warnings) { - this.warnings = warnings; - } } diff -r e7c4ae4b5eba -r 74a488e52dde src/main/java/de/intevation/lada/data/Repository.java --- 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 errors; + private Map warnings; + + /** * Get all objects of type clazzfrom database. * * @param clazz The class type. @@ -50,4 +58,58 @@ public T findById(Class 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 getErrors() { + return errors; + } + + /** + * Protected setter for validation errors. + * + * @param errors + */ + protected void setErrors(Map errors) { + this.errors = errors; + } + + /** + * Getter for all warnings occured while validating a LProbe object. + * + * @return Map of field - error code pairs. + */ + public Map getWarnings() { + return warnings; + } + + /** + * Protected setter for validation warnings. + * + * @param warnings + */ + protected void setWarnings(Map warnings) { + this.warnings = warnings; + } }