denormalized fields on statuses for faster queries

This commit is contained in:
Athou
2013-07-14 05:48:47 +02:00
parent ca9c10a1d3
commit 24ee418f3f
6 changed files with 123 additions and 77 deletions

View File

@@ -75,12 +75,11 @@ public class FeedUpdateService {
List<FeedEntryStatus> statusUpdateList = Lists.newArrayList();
List<User> users = Lists.newArrayList();
for (FeedSubscription sub : subscriptions) {
FeedEntryStatus status = new FeedEntryStatus();
status.setEntry(update);
User user = sub.getUser();
FeedEntryStatus status = new FeedEntryStatus(user, sub, update);
status.setSubscription(sub);
statusUpdateList.add(status);
users.add(sub.getUser());
users.add(user);
}
cache.invalidateUserData(users.toArray(new User[0]));
feedEntryDAO.saveOrUpdate(update);