Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/rest/ProbeService.java @ 1034:61354a9fa58d schema-update
Make dynamic inserts on probe and messung objects to avoid 'not null'-constraint error.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 31 Aug 2016 15:50:54 +0200 |
parents | 1c41c7b8f7c2 |
children | f92c96efa976 |
comparison
equal
deleted
inserted
replaced
1033:812e0cace5ba | 1034:61354a9fa58d |
---|---|
323 } | 323 } |
324 probe = factory.findMediaDesk(probe); | 324 probe = factory.findMediaDesk(probe); |
325 /* Persist the new probe object*/ | 325 /* Persist the new probe object*/ |
326 Response newProbe = repository.create(probe, "land"); | 326 Response newProbe = repository.create(probe, "land"); |
327 Probe ret = (Probe)newProbe.getData(); | 327 Probe ret = (Probe)newProbe.getData(); |
328 // Refreshing the probe object is necessary because probe objects use | |
329 // dynamic-insert, meaning null values are not written to the db and not | |
330 // updated after insert. | |
331 Response refreshed = | |
332 repository.getById(Probe.class, ret.getId(), "land"); | |
328 /* Create and persist a new probe translation object*/ | 333 /* Create and persist a new probe translation object*/ |
329 if(violation.hasWarnings()) { | 334 if(violation.hasWarnings()) { |
330 newProbe.setWarnings(violation.getWarnings()); | 335 refreshed.setWarnings(violation.getWarnings()); |
331 } | 336 } |
332 return authorization.filter( | 337 return authorization.filter( |
333 request, | 338 request, |
334 newProbe, | 339 refreshed, |
335 Probe.class); | 340 Probe.class); |
336 } | 341 } |
337 | 342 |
338 /** | 343 /** |
339 * Create new Probe objects from a messprogramm. | 344 * Create new Probe objects from a messprogramm. |