mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
move injection points where they belong
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.commafeed.backend.services;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Lock;
|
||||
import javax.ejb.LockType;
|
||||
import javax.ejb.Singleton;
|
||||
@@ -13,7 +11,6 @@ import com.commafeed.backend.dao.FeedDAO;
|
||||
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
||||
import com.commafeed.backend.feeds.FeedUtils;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
|
||||
@Singleton
|
||||
public class FeedService {
|
||||
@@ -39,19 +36,4 @@ public class FeedService {
|
||||
return feed;
|
||||
}
|
||||
|
||||
public void mergeFeeds(Feed into, List<Feed> feeds) {
|
||||
for (Feed feed : feeds) {
|
||||
if (into.getId().equals(feed.getId())) {
|
||||
continue;
|
||||
}
|
||||
List<FeedSubscription> subs = feedSubscriptionDAO.findByFeed(feed);
|
||||
for (FeedSubscription sub : subs) {
|
||||
sub.setFeed(into);
|
||||
}
|
||||
feedSubscriptionDAO.saveOrUpdate(subs);
|
||||
feedDAO.delete(feed);
|
||||
}
|
||||
feedDAO.saveOrUpdate(into);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user