2013-03-20 20:33:42 +01:00
|
|
|
package com.commafeed.backend.dao;
|
|
|
|
|
|
2013-03-24 13:11:05 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
|
2013-03-20 20:33:42 +01:00
|
|
|
import javax.ejb.Stateless;
|
|
|
|
|
|
2013-03-23 16:17:19 +01:00
|
|
|
import com.commafeed.backend.model.Feed;
|
2013-03-24 13:11:05 +01:00
|
|
|
import com.commafeed.frontend.utils.ModelFactory.MF;
|
|
|
|
|
import com.google.common.collect.Iterables;
|
2013-03-20 20:33:42 +01:00
|
|
|
|
|
|
|
|
@Stateless
|
2013-03-25 12:24:00 +01:00
|
|
|
@SuppressWarnings("serial")
|
2013-03-30 11:37:57 +01:00
|
|
|
public class FeedService extends GenericDAO<Feed> {
|
2013-03-20 20:33:42 +01:00
|
|
|
|
2013-03-24 13:11:05 +01:00
|
|
|
public Feed findByUrl(String url) {
|
|
|
|
|
List<Feed> feeds = findByField(MF.i(proxy().getUrl()), url);
|
|
|
|
|
return Iterables.getFirst(feeds, null);
|
|
|
|
|
}
|
2013-03-20 20:33:42 +01:00
|
|
|
}
|