Package com.mysema.query.jpa.hibernate

Examples of com.mysema.query.jpa.hibernate.HibernateQuery.list()


        QCat cat = QCat.cat;
        HibernateQuery query = query().from(cat).where(cat.name.isNotNull());
        HibernateQuery query2 = query.clone(session);
        assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
        assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
        query2.list(cat);
    }

}
View Full Code Here


    if (category == null) {
      query.where(sub.category.isNull());
    } else {
      query.where(sub.category.eq(category));
    }
    return initRelations(query.list(sub));
  }

  public List<FeedSubscription> findByCategories(User user, List<FeedCategory> categories) {
    List<Long> categoryIds = Lists.transform(categories, new Function<FeedCategory, Long>() {
      @Override
View Full Code Here

      query.orderBy(status.entryUpdated.desc(), status.id.desc());
    }

    query.offset(offset).limit(limit).setTimeout(config.getApplicationSettings().getQueryTimeout());

    List<FeedEntryStatus> statuses = query.list(status);
    for (FeedEntryStatus status : statuses) {
      status = handleStatus(user, status, status.getSubscription(), status.getEntry());
      fetchTags(user, status);
    }
    return lazyLoadContent(includeContent, statuses);
View Full Code Here

    Comparator<FeedEntryStatus> comparator = order == ReadingOrder.desc ? STATUS_COMPARATOR_DESC : STATUS_COMPARATOR_ASC;
    FixedSizeSortedSet<FeedEntryStatus> set = new FixedSizeSortedSet<FeedEntryStatus>(capacity, comparator);
    for (FeedSubscription sub : subs) {
      Date last = (order != null && set.isFull()) ? set.last().getEntryUpdated() : null;
      HibernateQuery query = buildQuery(user, sub, unreadOnly, keywords, newerThan, -1, capacity, order, last, tag);
      List<Tuple> tuples = query.list(entry.id, entry.updated, status.id);
      for (Tuple tuple : tuples) {
        Long id = tuple.get(entry.id);
        Date updated = tuple.get(entry.updated);
        Long statusId = tuple.get(status.id);
View Full Code Here

  }

  public UnreadCount getUnreadCount(User user, FeedSubscription subscription) {
    UnreadCount uc = null;
    HibernateQuery query = buildQuery(user, subscription, true, null, null, -1, -1, null, null, null);
    List<Tuple> tuples = query.list(entry.count(), entry.updated.max());
    for (Tuple tuple : tuples) {
      Long count = tuple.get(entry.count());
      Date updated = tuple.get(entry.updated.max());
      uc = new UnreadCount(subscription.getId(), count, updated);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.