package kuzumeji.action.home.erp.mng;
import kuzumeji.action.home.BaseEntityHome;
import kuzumeji.entity.erp.mng.ActualPeriod;
import kuzumeji.entity.erp.mng.ActualWork;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
@Name("actualWorkHome")
public class ActualWorkHome extends BaseEntityHome<ActualWork> {
    @In(create = true)
    ActualPeriodHome actualPeriodHome;
    public void setActualWorkId(Long id) {
        setId(id);
    }
    public Long getActualWorkId() {
        return (Long) getId();
    }
    @Override
    protected ActualWork createInstance() {
        ActualWork actualWork = new ActualWork();
        return actualWork;
    }
    public void load() {
        if (isIdDefined()) {
            wire();
        }
    }
    public void wire() {
        getInstance();
        ActualPeriod actualPeriod = actualPeriodHome.getDefinedInstance();
        if (actualPeriod != null) {
            getInstance().setActualPeriod(actualPeriod);
        }
    }
    public boolean isWired() {
        if (getInstance().getActualPeriod() == null) return false;
        return true;
    }
    public ActualWork getDefinedInstance() {
        return isIdDefined() ? getInstance() : null;
    }
}
