revert (GenericAbstractRemote is buggy)

This commit is contained in:
Peter Hormanns 2012-08-16 12:32:39 +02:00
parent d2dc9e575c
commit cf132cf569

View File

@ -13,66 +13,66 @@ import de.hsadmin.mods.dom.Domain;
import de.hsadmin.mods.dom.DomainOption; import de.hsadmin.mods.dom.DomainOption;
import de.hsadmin.mods.user.UnixUser; import de.hsadmin.mods.user.UnixUser;
public class DomainRemote extends GenericAbstractRemote { public class DomainRemote extends AbstractRemote {
@Override @Override
protected Class<? extends AbstractEntity> getEntityClass() { protected Class<? extends AbstractEntity> getEntityClass() {
return Domain.class; return Domain.class;
} }
// @Override @Override
// protected void entity2map(AbstractEntity entity, Map<String, Object> resultMap) { protected void entity2map(AbstractEntity entity, Map<String, Object> resultMap) {
// Domain dom = (Domain) entity; Domain dom = (Domain) entity;
// String id = Long.toString(dom.getId()); String id = Long.toString(dom.getId());
// resultMap.put("id", id); resultMap.put("id", id);
// String name = dom.getName(); String name = dom.getName();
// resultMap.put("name", name); resultMap.put("name", name);
// String user = dom.getUser().getName(); String user = dom.getUser().getName();
// resultMap.put("user", user); resultMap.put("user", user);
// String hive = dom.getHiveName(); String hive = dom.getHiveName();
// resultMap.put("hive", hive); resultMap.put("hive", hive);
// String pac = dom.getUser().getPac().getName(); String pac = dom.getUser().getPac().getName();
// resultMap.put("pac", pac); resultMap.put("pac", pac);
// Date sDate = dom.getSince(); Date sDate = dom.getSince();
// if (assertNotNull(sDate)) { if (assertNotNull(sDate)) {
// String since = TextUtil.format(sDate); String since = TextUtil.format(sDate);
// resultMap.put("since", since); resultMap.put("since", since);
// } }
// List<String> domainOptionsList = new ArrayList<String>(); List<String> domainOptionsList = new ArrayList<String>();
// resultMap.put("domainoptions", domainOptionsList); resultMap.put("domainoptions", domainOptionsList);
// Set<DomainOption> domainOptions = dom.getDomainOptions(); Set<DomainOption> domainOptions = dom.getDomainoptions();
// if (domainOptions != null) { if (domainOptions != null) {
// for (DomainOption opt : domainOptions) { for (DomainOption opt : domainOptions) {
// domainOptionsList.add(opt.getName()); domainOptionsList.add(opt.getName());
// } }
// } }
// } }
// @Override @Override
// protected void map2entity(Map<String, Object> setParams, AbstractEntity entity) { protected void map2entity(Map<String, Object> setParams, AbstractEntity entity) {
// Domain dom = (Domain) entity; Domain dom = (Domain) entity;
// String name = (String) setParams.get("name"); String name = (String) setParams.get("name");
// String user = (String) setParams.get("user"); String user = (String) setParams.get("user");
// if (assertNotNull(name)) { if (assertNotNull(name)) {
// dom.setName(name); dom.setName(name);
// } }
// if (assertNotNull(user)) { if (assertNotNull(user)) {
// UnixUser u = new UnixUser(); UnixUser u = new UnixUser();
// u.setName(user); u.setName(user);
// dom.setUser(u); dom.setUser(u);
// } }
// 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>(); 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) {