Exemple #1
0
  @SuppressWarnings("unchecked")
  public List<BpelEvent> listEvents() {
    entering("ScopeDaoImpl.listEvents");
    //        CriteriaBuilder cb = new CriteriaBuilder();
    Criteria crit = _sm.getSession().createCriteria(HBpelEvent.class);
    //        if (efilter != null)
    //            cb.buildCriteria(crit, efilter);
    crit.add(Restrictions.eq("scopeId", _scope.getId()));

    List<HBpelEvent> hevents = crit.list();
    List<BpelEvent> ret = new ArrayList<BpelEvent>(hevents.size());
    try {
      CollectionsX.transformEx(
          ret,
          hevents,
          new UnaryFunctionEx<HBpelEvent, BpelEvent>() {
            public BpelEvent apply(HBpelEvent x) throws Exception {
              return (BpelEvent)
                  SerializableUtils.toObject(x.getData(), BpelEvent.class.getClassLoader());
            }
          });
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }
    return ret;
  }