mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
populate statuses as read when a user subscribes
This commit is contained in:
@@ -7,6 +7,7 @@ import javax.ejb.Stateless;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.uaihebert.model.EasyCriteria;
|
||||
|
||||
@Stateless
|
||||
@SuppressWarnings("serial")
|
||||
@@ -16,4 +17,11 @@ public class FeedService extends GenericDAO<Feed> {
|
||||
List<Feed> feeds = findByField(MF.i(proxy().getUrl()), url);
|
||||
return Iterables.getFirst(feeds, null);
|
||||
}
|
||||
|
||||
public Feed getByIdWithEntries(Long feedId) {
|
||||
EasyCriteria<Feed> criteria = createCriteria();
|
||||
criteria.andEquals(MF.i(proxy().getId()), feedId);
|
||||
criteria.leftJoinFetch(MF.i(proxy().getEntries()));
|
||||
return criteria.getSingleResult();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user