ability to subscribe to a feed

This commit is contained in:
Athou
2013-03-24 13:11:05 +01:00
parent 17fe01ade4
commit fb40ced8a1
16 changed files with 828 additions and 9 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}