HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-07-25 3a386fb24e9ca3a7e1b8f793fd7cd44fedc8a824
dont delete domainoptions if no new value is given
2 files modified
10 ■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java 6 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/remote/DomainRemote.java 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java
@@ -159,9 +159,9 @@
                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();
hsarback/src/de/hsadmin/remote/DomainRemote.java
@@ -61,17 +61,17 @@
            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