query not used anymore

This commit is contained in:
Athou
2014-08-14 11:18:30 +02:00
parent c1b8619b26
commit cda6cb5cc0

View File

@@ -14,7 +14,6 @@ import com.commafeed.backend.model.QUser;
import com.google.common.collect.Iterables;
import com.mysema.query.BooleanBuilder;
import com.mysema.query.jpa.hibernate.HibernateQuery;
import com.mysema.query.jpa.hibernate.HibernateSubQuery;
public class FeedDAO extends GenericDAO<Feed> {
@@ -24,22 +23,6 @@ public class FeedDAO extends GenericDAO<Feed> {
super(sessionFactory);
}
public Long getUpdatableCount(Date lastLoginThreshold) {
BooleanBuilder disabledDatePredicate = new BooleanBuilder();
disabledDatePredicate.or(feed.disabledUntil.isNull());
disabledDatePredicate.or(feed.disabledUntil.lt(new Date()));
HibernateQuery query = newQuery().from(feed).where(disabledDatePredicate);
if (lastLoginThreshold != null) {
QFeedSubscription sub = QFeedSubscription.feedSubscription;
QUser user = QUser.user;
HibernateSubQuery subquery = new HibernateSubQuery();
subquery.from(sub).join(sub.user, user).where(sub.feed.eq(feed), user.lastLogin.gt(lastLoginThreshold));
query.where(subquery.exists());
}
return query.orderBy(feed.disabledUntil.asc()).count();
}
public List<Feed> findNextUpdatable(int count, Date lastLoginThreshold) {
BooleanBuilder disabledDatePredicate = new BooleanBuilder();
disabledDatePredicate.or(feed.disabledUntil.isNull());