fix default pricelist setting

This commit is contained in:
Peter Hormanns 2017-12-29 18:08:46 +01:00
parent 624d73086f
commit d81734371c

View File

@ -22,6 +22,8 @@ import de.hsadmin.login.RequiredScope;
import de.hsadmin.login.Role; import de.hsadmin.login.Role;
import de.hsadmin.login.ScopePolicy; import de.hsadmin.login.ScopePolicy;
import de.hsadmin.module.impl.AbstractModule; import de.hsadmin.module.impl.AbstractModule;
import de.hsadmin.module.property.StringSet;
import de.hsadmin.module.property.StringSetProperty;
import de.hsadmin.module.util.QueryBuilder; import de.hsadmin.module.util.QueryBuilder;
@Stateless @Stateless
@ -45,7 +47,9 @@ public class CustomerService extends AbstractModule<CustomerVO> implements Custo
final CustomerVO customerVO = super.create(requestContext, prototype); final CustomerVO customerVO = super.create(requestContext, prototype);
final String[] priceLists = customerVO.getPriceLists(); final String[] priceLists = customerVO.getPriceLists();
if (priceLists == null) { if (priceLists == null) {
customerVO.setPriceLists(new String[] { "Standard" }); final StringSet stringSet = new StringSet();
stringSet.setStrings(new String[] { "Standard" });
((StringSetProperty) customerVO.get("priceLists")).setValue(stringSet);
} }
final Customer customerBO = new Customer(); final Customer customerBO = new Customer();
customerVO.copyPropertiesToPersistentObject(customerBO); customerVO.copyPropertiesToPersistentObject(customerBO);