dont delete domainoptions if no new value is given
This commit is contained in:
parent
2171a5cf82
commit
3a386fb24e
@ -159,9 +159,9 @@ public class DomainModuleImpl extends AbstractModuleImpl {
|
|||||||
DomainOption.class.getAnnotation(javax.persistence.Entity.class).name() +
|
DomainOption.class.getAnnotation(javax.persistence.Entity.class).name() +
|
||||||
" opt WHERE opt.name=:optName");
|
" opt WHERE opt.name=:optName");
|
||||||
Set<DomainOption> domainOptions = updatedDom.getDomainOptions();
|
Set<DomainOption> domainOptions = updatedDom.getDomainOptions();
|
||||||
if (domainOptions == null) {
|
// if (domainOptions == null) {
|
||||||
updatedDom.setDomainOptions(oldDom.getDomainOptions());
|
// updatedDom.setDomainOptions(oldDom.getDomainOptions());
|
||||||
}
|
// }
|
||||||
for (DomainOption opt : domainOptions) {
|
for (DomainOption opt : domainOptions) {
|
||||||
q.setParameter("optName", opt.getName());
|
q.setParameter("optName", opt.getName());
|
||||||
List<?> list = q.getResultList();
|
List<?> list = q.getResultList();
|
||||||
|
@ -61,18 +61,18 @@ public class DomainRemote extends AbstractRemote {
|
|||||||
u.setName(user);
|
u.setName(user);
|
||||||
dom.setUser(u);
|
dom.setUser(u);
|
||||||
}
|
}
|
||||||
Set<DomainOption> domainOptionsSet = new HashSet<DomainOption>();
|
|
||||||
Object domOptsObj = setParams.get("domainoptions");
|
Object domOptsObj = setParams.get("domainoptions");
|
||||||
if (domOptsObj != null && domOptsObj instanceof Object[]) {
|
if (domOptsObj != null && domOptsObj instanceof Object[]) {
|
||||||
|
Set<DomainOption> domainOptionsSet = new HashSet<DomainOption>();
|
||||||
Object[] domOptions = (Object[]) domOptsObj;
|
Object[] domOptions = (Object[]) domOptsObj;
|
||||||
for (int i=0; i<domOptions.length; i++) {
|
for (int i=0; i<domOptions.length; i++) {
|
||||||
DomainOption domainOption = new DomainOption();
|
DomainOption domainOption = new DomainOption();
|
||||||
domainOption.setName((String)domOptions[i]);
|
domainOption.setName((String)domOptions[i]);
|
||||||
domainOptionsSet.add(domainOption);
|
domainOptionsSet.add(domainOption);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dom.setDomainOptions(domainOptionsSet);
|
dom.setDomainOptions(domainOptionsSet);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void regularizeKeys(Map<String, String> whereParams) {
|
protected void regularizeKeys(Map<String, String> whereParams) {
|
||||||
|
Loading…
Reference in New Issue
Block a user