Package org.apache.openejb

Examples of org.apache.openejb.Extensions$Finder


    }
  }

  public Content getSide(Integer id, Integer siteId, Integer channelId,
      boolean next, boolean cacheable) {
    Finder f = Finder.create("from Content bean where 1=1");
    if (channelId != null) {
      f.append(" and bean.channel.id=:channelId");
      f.setParam("channelId", channelId);
    } else if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if (next) {
      f.append(" and bean.id>:id");
      f.setParam("id", id);
      f.append(" and bean.status=" + ContentCheck.CHECKED);
      f.append(" order by bean.id asc");
    } else {
      f.append(" and bean.id<:id");
      f.setParam("id", id);
      f.append(" and bean.status=" + ContentCheck.CHECKED);
      f.append(" order by bean.id desc");
    }
    Query query = f.createQuery(getSession());
    query.setCacheable(cacheable).setMaxResults(1);
    return (Content) query.uniqueResult();
  }
View Full Code Here


    return (Content) query.uniqueResult();
  }

  @SuppressWarnings("unchecked")
  public List<Content> getListByIdsForTag(Integer[] ids, int orderBy) {
    Finder f = Finder.create("from Content bean where bean.id in (:ids)");
    f.setParamList("ids", ids);
    appendOrder(f, orderBy);
    f.setCacheable(true);
    return find(f);
  }
View Full Code Here

  }

  public Pagination getPageBySiteIdsForTag(Integer[] siteIds,
      Integer[] typeIds, Boolean titleImg, Boolean recommend,
      String title, int orderBy, int pageNo, int pageSize) {
    Finder f = bySiteIds(siteIds, typeIds, titleImg, recommend, title,
        orderBy);
    f.setCacheable(true);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Content> getListBySiteIdsForTag(Integer[] siteIds,
      Integer[] typeIds, Boolean titleImg, Boolean recommend,
      String title, int orderBy, Integer first, Integer count) {
    Finder f = bySiteIds(siteIds, typeIds, titleImg, recommend, title,
        orderBy);
    if (first != null) {
      f.setFirstResult(first);
    }
    if (count != null) {
      f.setMaxResults(count);
    }
    f.setCacheable(true);
    return find(f);
  }
View Full Code Here

  }

  public Pagination getPageByChannelIdsForTag(Integer[] channelIds,
      Integer[] typeIds, Boolean titleImg, Boolean recommend,
      String title, int orderBy, int option, int pageNo, int pageSize) {
    Finder f = byChannelIds(channelIds, typeIds, titleImg, recommend,
        title, orderBy, option);
    f.setCacheable(true);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Content> getListByChannelIdsForTag(Integer[] channelIds,
      Integer[] typeIds, Boolean titleImg, Boolean recommend,
      String title, int orderBy, int option, Integer first, Integer count) {
    Finder f = byChannelIds(channelIds, typeIds, titleImg, recommend,
        title, orderBy, option);
    if (first != null) {
      f.setFirstResult(first);
    }
    if (count != null) {
      f.setMaxResults(count);
    }
    f.setCacheable(true);
    return find(f);
  }
View Full Code Here

  public Pagination getPageByChannelPathsForTag(String[] paths,
      Integer[] siteIds, Integer[] typeIds, Boolean titleImg,
      Boolean recommend, String title, int orderBy, int pageNo,
      int pageSize) {
    Finder f = byChannelPaths(paths, siteIds, typeIds, titleImg, recommend,
        title, orderBy);
    f.setCacheable(true);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Content> getListByChannelPathsForTag(String[] paths,
      Integer[] siteIds, Integer[] typeIds, Boolean titleImg,
      Boolean recommend, String title, int orderBy, Integer first,
      Integer count) {
    Finder f = byChannelPaths(paths, siteIds, typeIds, titleImg, recommend,
        title, orderBy);
    if (first != null) {
      f.setFirstResult(first);
    }
    if (count != null) {
      f.setMaxResults(count);
    }
    f.setCacheable(true);
    return find(f);
  }
View Full Code Here

  public Pagination getPageByTopicIdForTag(Integer topicId,
      Integer[] siteIds, Integer[] channelIds, Integer[] typeIds,
      Boolean titleImg, Boolean recommend, String title, int orderBy,
      int pageNo, int pageSize) {
    Finder f = byTopicId(topicId, siteIds, channelIds, typeIds, titleImg,
        recommend, title, orderBy);
    f.setCacheable(true);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Content> getListByTopicIdForTag(Integer topicId,
      Integer[] siteIds, Integer[] channelIds, Integer[] typeIds,
      Boolean titleImg, Boolean recommend, String title, int orderBy,
      Integer first, Integer count) {
    Finder f = byTopicId(topicId, siteIds, channelIds, typeIds, titleImg,
        recommend, title, orderBy);
    if (first != null) {
      f.setFirstResult(first);
    }
    if (count != null) {
      f.setMaxResults(count);
    }
    f.setCacheable(true);
    return find(f);
  }
View Full Code Here

TOP

Related Classes of org.apache.openejb.Extensions$Finder

Copyright © 2018 www.massapicom. 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.