# HG changeset patch # User Raimund Renkert # Date 1371035906 -7200 # Node ID 39a501f3ace22cb9170d6c8fb4571ccc92e05ec5 # Parent 30e3ae65cd942b4db1136afaeb140d302fc6ee77 Moved the validator to create/update methods. diff -r 30e3ae65cd94 -r 39a501f3ace2 src/main/java/de/intevation/lada/data/LProbeRepository.java --- 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);