package kuzumeji.action.home.erp;
import java.util.ArrayList;
import java.util.List;
import kuzumeji.action.home.BaseEntityHome;
import kuzumeji.entity.erp.Customer;
import kuzumeji.entity.erp.mng.Activity;
import org.jboss.seam.annotations.Name;
/**
 * CustomerHome
 * @author nilcy
 */
@Name("customerHome")
public class CustomerHome extends BaseEntityHome<Customer> {
    /** S/N */
    private static final long serialVersionUID = -1029434580934113803L;
    /**
     * getCustomerId
     * @return CustomerId
     */
    public Long getCustomerId() {
        return (Long) getId();
    }
    /**
     * setCustomerId
     * @param aCustomerId CustomerId
     */
    public void setCustomerId(Long aCustomerId) {
        setId(aCustomerId);
    }
    @Override
    protected Customer createInstance() {
        Customer customer = new Customer();
        return customer;
    }
    /**
     * load
     */
    public void load() {
        if (isIdDefined()) {
            wire();
        }
    }
    /**
     * wire
     */
    public void wire() {
        getInstance();
    }
    /**
     * isWired
     * @return isWired
     */
    public boolean isWired() {
        return true;
    }
    /**
     * getDefinedInstance
     * @return DefinedInstance
     */
    public Customer getDefinedInstance() {
        return isIdDefined() ? getInstance() : null;
    }
    /**
     * getActivities
     * @return Activities
     */
    public List<Activity> getActivities() {
        return getInstance() == null ? null : new ArrayList<Activity>(getInstance().getActivities());
    }
}
