dont delete domainoptions if no new value is given

This commit is contained in:
Peter Hormanns 2012-07-25 15:53:03 +00:00
parent 2171a5cf82
commit 3a386fb24e
2 changed files with 5 additions and 5 deletions

View File

@ -159,9 +159,9 @@ public class DomainModuleImpl extends AbstractModuleImpl {
DomainOption.class.getAnnotation(javax.persistence.Entity.class).name() +
" opt WHERE opt.name=:optName");
Set<DomainOption> domainOptions = updatedDom.getDomainOptions();
if (domainOptions == null) {
updatedDom.setDomainOptions(oldDom.getDomainOptions());
}
// if (domainOptions == null) {
// updatedDom.setDomainOptions(oldDom.getDomainOptions());
// }
for (DomainOption opt : domainOptions) {
q.setParameter("optName", opt.getName());
List<?> list = q.getResultList();

View File

@ -61,17 +61,17 @@ public class DomainRemote extends AbstractRemote {
u.setName(user);
dom.setUser(u);
}
Set<DomainOption> domainOptionsSet = new HashSet<DomainOption>();
Object domOptsObj = setParams.get("domainoptions");
if (domOptsObj != null && domOptsObj instanceof Object[]) {
Set<DomainOption> domainOptionsSet = new HashSet<DomainOption>();
Object[] domOptions = (Object[]) domOptsObj;
for (int i=0; i<domOptions.length; i++) {
DomainOption domainOption = new DomainOption();
domainOption.setName((String)domOptions[i]);
domainOptionsSet.add(domainOption);
}
dom.setDomainOptions(domainOptionsSet);
}
dom.setDomainOptions(domainOptionsSet);
}
@Override