Package com.mysema.query.jpa.hibernate

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


  }

  public List<FeedSubscription> findByCategory(User user, FeedCategory category) {
    HibernateQuery query = newQuery().from(sub).where(sub.user.eq(user));
    if (category == null) {
      query.where(sub.category.isNull());
    } else {
      query.where(sub.category.eq(category));
    }
    return initRelations(query.list(sub));
  }
View Full Code Here


  public List<FeedSubscription> findByCategory(User user, FeedCategory category) {
    HibernateQuery query = newQuery().from(sub).where(sub.user.eq(user));
    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) {
View Full Code Here

  }

  public List<FeedEntryStatus> findStarred(User user, Date newerThan, int offset, int limit, ReadingOrder order, boolean includeContent) {
    HibernateQuery query = newQuery().from(status).where(status.user.eq(user), status.starred.isTrue());
    if (newerThan != null) {
      query.where(status.entryInserted.gt(newerThan));
    }

    if (order == ReadingOrder.asc) {
      query.orderBy(status.entryUpdated.asc(), status.id.asc());
    } else {
View Full Code Here

        or.or(content.content.containsIgnoreCase(keyword.getKeyword()));
        or.or(content.title.containsIgnoreCase(keyword.getKeyword()));
        if (keyword.getMode() == Mode.EXCLUDE) {
          or.not();
        }
        query.where(or);
      }
    }
    query.leftJoin(entry.statuses, status).on(status.subscription.id.eq(sub.getId()));

    if (unreadOnly && tag == null) {
View Full Code Here

    if (unreadOnly && tag == null) {
      BooleanBuilder or = new BooleanBuilder();
      or.or(status.read.isNull());
      or.or(status.read.isFalse());
      query.where(or);

      Date unreadThreshold = config.getApplicationSettings().getUnreadThreshold();
      if (unreadThreshold != null) {
        query.where(entry.updated.goe(unreadThreshold));
      }
View Full Code Here

      or.or(status.read.isFalse());
      query.where(or);

      Date unreadThreshold = config.getApplicationSettings().getUnreadThreshold();
      if (unreadThreshold != null) {
        query.where(entry.updated.goe(unreadThreshold));
      }
    }

    if (tag != null) {
      BooleanBuilder and = new BooleanBuilder();
View Full Code Here

      and.and(entryTag.name.eq(tag));
      query.join(entry.tags, entryTag).on(and);
    }

    if (newerThan != null) {
      query.where(entry.inserted.goe(newerThan));
    }

    if (last != null) {
      if (order == ReadingOrder.desc) {
        query.where(entry.updated.gt(last));
View Full Code Here

      query.where(entry.inserted.goe(newerThan));
    }

    if (last != null) {
      if (order == ReadingOrder.desc) {
        query.where(entry.updated.gt(last));
      } else {
        query.where(entry.updated.lt(last));
      }
    }
View Full Code Here

    if (last != null) {
      if (order == ReadingOrder.desc) {
        query.where(entry.updated.gt(last));
      } else {
        query.where(entry.updated.lt(last));
      }
    }

    if (order != null) {
      if (order == ReadingOrder.asc) {
View Full Code Here

    if (lastLoginThreshold != null) {
      QFeedSubscription subs = QFeedSubscription.feedSubscription;
      QUser user = QUser.user;
      query.join(feed.subscriptions, subs).join(subs.user, user).where(disabledDatePredicate, user.lastLogin.gt(lastLoginThreshold));
    } else {
      query.where(disabledDatePredicate);
    }

    return query.orderBy(feed.disabledUntil.asc()).limit(count).distinct().list(feed);
  }
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.