dont delete domainoptions if no new value is given
This commit is contained in:
parent
3dd8a09e9e
commit
2171a5cf82
@ -3,6 +3,7 @@ package de.hsadmin.mods.dom;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.Query;
|
||||
@ -157,7 +158,11 @@ public class DomainModuleImpl extends AbstractModuleImpl {
|
||||
Query q = em.createQuery("SELECT opt FROM " +
|
||||
DomainOption.class.getAnnotation(javax.persistence.Entity.class).name() +
|
||||
" opt WHERE opt.name=:optName");
|
||||
for (DomainOption opt : updatedDom.getDomainOptions()) {
|
||||
Set<DomainOption> domainOptions = updatedDom.getDomainOptions();
|
||||
if (domainOptions == null) {
|
||||
updatedDom.setDomainOptions(oldDom.getDomainOptions());
|
||||
}
|
||||
for (DomainOption opt : domainOptions) {
|
||||
q.setParameter("optName", opt.getName());
|
||||
List<?> list = q.getResultList();
|
||||
if (list.size() != 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user