package kuzumeji.action.home.erp.mng;
import kuzumeji.action.home.BaseEntityHome;
import kuzumeji.entity.erp.mng.PlanWork;
import kuzumeji.entity.erp.mng.PlanWorkDetail;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
@Name("planWorkDetailHome")
public class PlanWorkDetailHome extends BaseEntityHome<PlanWorkDetail> {
    @In(create = true)
    PlanWorkHome planWorkHome;
    public void setPlanWorkDetailId(Long id) {
        setId(id);
    }
    public Long getPlanWorkDetailId() {
        return (Long) getId();
    }
    @Override
    protected PlanWorkDetail createInstance() {
        PlanWorkDetail planWorkDetail = new PlanWorkDetail();
        return planWorkDetail;
    }
    public void load() {
        if (isIdDefined()) {
            wire();
        }
    }
    public void wire() {
        getInstance();
        PlanWork planWork = planWorkHome.getDefinedInstance();
        if (planWork != null) {
            getInstance().setPlanWork(planWork);
        }
    }
    public boolean isWired() {
        if (getInstance().getPlanWork() == null) return false;
        return true;
    }
    public PlanWorkDetail getDefinedInstance() {
        return isIdDefined() ? getInstance() : null;
    }
}
