@Override
@Nonnull
public List<ChangeHistory> getChangeHistoriesSince(@Nonnull final Issue issue, @Nonnull final Date since)
{
notNull("issue", issue);
notNull("since", since);
EntityCondition issueCondition = new EntityExpr("issue", EntityOperator.EQUALS, issue.getId());
EntityCondition dateCondition = new EntityExpr("created", EntityOperator.GREATER_THAN, new Timestamp(since.getTime()));
EntityCondition finalCondition = new EntityConditionList(Arrays.asList(issueCondition, dateCondition), EntityOperator.AND);
List<GenericValue> changeHistoriesSinceDate = ofBizDelegator.findByCondition(Entity.Name.CHANGE_GROUP, finalCondition, null, ImmutableList.of("created DESC", "id ASC"));
return copyOf(Iterables.transform(changeHistoriesSinceDate, new Function<GenericValue, ChangeHistory>()
{
@Override
public ChangeHistory apply(@Nullable final GenericValue genericValue)
{
return genericValue != null ? new ChangeHistory(genericValue, issueManager, userManager) : null;
}
}));
}