Fehlerkorrektur

This commit is contained in:
Peter Hormanns 2011-05-19 15:31:37 +00:00
parent eb4ed908ac
commit eb9c4b0a80
3 changed files with 16 additions and 6 deletions

View File

@ -95,7 +95,7 @@ public class Customer extends de.hsadmin.core.model.AbstractEntity implements Se
} }
public static String createQueryFromStringKey(String humanKey) { public static String createQueryFromStringKey(String humanKey) {
return "name='" + humanKey + "'"; return "obj.name='" + humanKey + "'";
} }
@Override @Override

View File

@ -1,5 +1,6 @@
package de.hsadmin.mods.cust; package de.hsadmin.mods.cust;
import java.util.Calendar;
import java.util.List; import java.util.List;
import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractEntity;
@ -59,10 +60,19 @@ public class CustomerModuleImpl extends AbstractModuleImpl {
throw new HSAdminException("role hostmaster required to delete customers"); throw new HSAdminException("role hostmaster required to delete customers");
} }
Customer cust = (Customer) existingEntity; Customer cust = (Customer) existingEntity;
GenericModuleImpl helper = new GenericModuleImpl(getTransaction()); // Diese Zeilen loeschen den hsh00-Mitglieds-Account
AbstractEntity custAccount = helper.findByString(UnixUser.class, cust.getName()); // GenericModuleImpl helper = new GenericModuleImpl(getTransaction());
helper.delete(custAccount); // AbstractEntity custAccount = helper.findByString(UnixUser.class, cust.getName());
super.delete(existingEntity); // helper.delete(custAccount);
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
cal.set(Calendar.MONTH, Calendar.DECEMBER);
cal.set(Calendar.DAY_OF_MONTH, 31);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.SECOND, 59);
cust.setMemberUntil(cal.getTime());
super.update(existingEntity);
} }
private void assertNotNull(String name, String value) throws HSAdminException { private void assertNotNull(String name, String value) throws HSAdminException {

View File

@ -75,7 +75,7 @@ public class Domain extends AbstractEntity {
} }
public static String createQueryFromStringKey(String humanKey) { public static String createQueryFromStringKey(String humanKey) {
return "name = '" + humanKey + "'"; return "obj.name='" + humanKey + "'";
} }
@Override @Override