Ejemplo n.º 1
0
  @Override
  public BranchBean load(Branch model) {

    if (model == null) throw new IllegalStateException();

    this.model = model;

    this.id = model.getId();
    this.name = model.getBehavior().getName();

    List<? extends EnterpriseBehavior> parents =
        model.getBehavior().getParent("structureDimension", EnterpriseEntityType.COMPANY);
    if (parents != null && parents.size() > 0)
      this.company = new CompanyBean().load((Company) parents.get(0).getEntity(), true);

    return this;
  }
Ejemplo n.º 2
0
  @Override
  public List<BranchBean> updateBeans() {

    List<BranchBean> list = new ArrayList<BranchBean>();

    List<Branch> listM = getManager().list();
    for (Branch branch : listM) {

      branch =
          (Branch)
              wrapper
                  .loadLazyProperty(branch.getBehavior(), "getParentAccountabilities")
                  .getEntity();
      list.add(new BranchBean().load(branch));
    }

    return list;
  }