Criteria c = _sm.getSession().createCriteria(HBpelEvent.class);
c.add(Restrictions.eq("instance", _instance));
c.setProjection(Projections.projectionList().add(Projections.min("tstamp")).add(Projections.max("tstamp")).add(
Projections.count("tstamp")));
Object[] ret = (Object[]) c.uniqueResult();
EventsFirstLastCountTuple flc = new EventsFirstLastCountTuple();
flc.first = (Date) ret[0];
flc.last = (Date) ret[1];
flc.count = (Integer) ret[2];
return flc;