Mercurial > lada > lada-server
changeset 111:39a501f3ace2
Moved the validator to create/update methods.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 12 Jun 2013 13:18:26 +0200 |
parents | 30e3ae65cd94 |
children | 094e4c344c08 |
files | src/main/java/de/intevation/lada/data/LProbeRepository.java |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LProbeRepository.java Wed Jun 12 13:17:09 2013 +0200 +++ b/src/main/java/de/intevation/lada/data/LProbeRepository.java Wed Jun 12 13:18:26 2013 +0200 @@ -18,6 +18,7 @@ import de.intevation.lada.manage.LProbeManager; import de.intevation.lada.model.LProbe; import de.intevation.lada.rest.Response; +import de.intevation.lada.validation.LProbeValidator; import de.intevation.lada.validation.ValidationException; import de.intevation.lada.validation.Validator; @@ -30,10 +31,6 @@ @ApplicationScoped public class LProbeRepository extends Repository{ - @Inject - @Named("lprobevalidator") - private Validator validator; - /** * The entitymanager managing the data. */ @@ -108,6 +105,7 @@ */ public Response create(LProbe probe) { Response response = new Response(true, 200, probe); + Validator validator = new LProbeValidator(); // Try to save the new LProbe. try { validator.validate(probe); @@ -142,6 +140,7 @@ public Response update(LProbe probe) { Response response = new Response(true, 200, probe); + Validator validator = new LProbeValidator(); // Try to save the new LProbe. try { validator.validate(probe);