Exemplo n.º 1
0
  private List<ApplicationDMO> getResults(Collection<String> appIds) {
    DataModel model = DataService.getModel();
    DMSession session = model.currentSessionRO();

    List<ApplicationDMO> result = new ArrayList<ApplicationDMO>();

    for (String id : appIds) {
      result.add(session.findUnchecked(ApplicationDMO.class, id));
    }

    return result;
  }
Exemplo n.º 2
0
  private List<ApplicationDMO> getResults(Pageable<ApplicationView> pageable) {
    // FIXME this is wasteful; we create ApplicationView then just get the IDs from
    // the views and use them to create an ApplicationDMO, which itself has an ApplicationView
    // internally

    DataModel model = DataService.getModel();
    DMSession session = model.currentSessionRO();

    List<ApplicationDMO> result = new ArrayList<ApplicationDMO>();

    for (ApplicationView appView : pageable.getResults()) {
      result.add(session.findUnchecked(ApplicationDMO.class, appView.getApplication().getId()));
    }

    return result;
  }