package kuzumeji.action.home.erp.mng;
import kuzumeji.action.home.BaseEntityHome;
import kuzumeji.entity.erp.mng.PlanExpense;
import kuzumeji.entity.erp.mng.PlanExpenseDetail;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
@Name("planExpenseDetailHome")
public class PlanExpenseDetailHome extends BaseEntityHome<PlanExpenseDetail> {
    @In(create = true)
    PlanExpenseHome planExpenseHome;
    public void setPlanExpenseDetailId(Long id) {
        setId(id);
    }
    public Long getPlanExpenseDetailId() {
        return (Long) getId();
    }
    @Override
    protected PlanExpenseDetail createInstance() {
        PlanExpenseDetail planExpenseDetail = new PlanExpenseDetail();
        return planExpenseDetail;
    }
    public void load() {
        if (isIdDefined()) {
            wire();
        }
    }
    public void wire() {
        getInstance();
        PlanExpense planExpense = planExpenseHome.getDefinedInstance();
        if (planExpense != null) {
            getInstance().setPlanExpense(planExpense);
        }
    }
    public boolean isWired() {
        if (getInstance().getPlanExpense() == null) return false;
        return true;
    }
    public PlanExpenseDetail getDefinedInstance() {
        return isIdDefined() ? getInstance() : null;
    }
}
