mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
ability to subscribe to a feed
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
package com.commafeed.backend.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.frontend.utils.ModelFactory.MF;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
@Stateless
|
||||
public class FeedService extends GenericDAO<Feed, Long> {
|
||||
|
||||
public Feed findByUrl(String url) {
|
||||
List<Feed> feeds = findByField(MF.i(proxy().getUrl()), url);
|
||||
return Iterables.getFirst(feeds, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class GenericDAO<T, K> implements
|
||||
em.remove(object);
|
||||
}
|
||||
|
||||
public void deleteById(Object id) {
|
||||
public void deleteById(K id) {
|
||||
Object ref = em.getReference(getType(), id);
|
||||
em.remove(ref);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user