query.setTimestamp("to", finishDate.getDate());
}
if (targetChannel != null) {
query.setEntity("targetChannel", targetChannel);
}
ScrollableResults hhData = query.scroll();
HhStartDate groupStart = null;
if (hhData.next()) {
groupStart = (HhStartDate) hhData.get(0);
if (targetChannel == null) {
throw new UserException("There is no channel for the "