Package org.apache.openejb

Examples of org.apache.openejb.Extensions$Finder


    return find(f);
  }

  public long getUniqueVisitorCountByTimeRange(Integer siteId,
      TimeRange timeRange) {
    Finder f = createCacheableFinder("select count(distinct bean.sessionId) from CmsSiteFlow bean");
    return byTimeRange(f, siteId, timeRange);
  }
View Full Code Here


    return getUniqueVisitorCountByTimeRange(siteId, null);
  }

  public Pagination flowAnalysisPage(String groupCondition, Integer siteId,
      Integer pageNo, Integer pageSize) {
    Finder f = createCacheableFinder("select count(*),bean."
        + groupCondition
        + " from CmsSiteFlow bean where bean.site.id=:siteId group by bean."
        + groupCondition + " order by count(*) desc");
    f.setParam("siteId", siteId);
    f.setMaxResults(pageSize);
    f.setFirstResult((pageNo - 1) * pageSize);
    return new Pagination(pageNo, pageSize, getTotalCount(f.getOrigHql(),
        siteId), find(f));
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public List<Channel> getTopListByRigth(Integer userId, Integer siteId,
      boolean hasContentOnly) {
    Finder f = Finder.create("select bean from Channel bean");
    f.append(" join bean.users user");
    f.append(" where user.id=:userId and bean.site.id=:siteId");
    f.setParam("userId", userId).setParam("siteId", siteId);
    if (hasContentOnly) {
      f.append(" and bean.hasContent=true");
    }
    f.append(" and bean.parent.id is null");
    f.append(" order by bean.priority asc,bean.id asc");
    return find(f);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public List<Channel> getChildList(Integer parentId, boolean hasContentOnly,
      boolean displayOnly, boolean cacheable) {
    Finder f = getChildFinder(parentId, hasContentOnly, displayOnly,
        cacheable);
    return find(f);
  }
View Full Code Here

    return new Pagination(pageNo, pageSize, getTotalCount(f.getOrigHql(),
        siteId), find(f));
  }

  public void flowInit(Integer siteId, Date startDate, Date endDate) {
    Finder f = Finder.create("delete from CmsSiteFlow bean where bean.site.id=:siteId");
    f.setParam("siteId", siteId);
    if (startDate != null) {
      f.append(" and bean.accessTime >= :startDate");
      f.setParam("startDate", startDate);
    }
    if (endDate != null) {
      f.append(" and bean.accessTime <= :endDate");
      f.setParam("endDate", endDate);
    }
    Query query = f.createQuery(getSession());
    query.executeUpdate();
  }
View Full Code Here

    return find(f);
  }

  public Pagination getChildPage(Integer parentId, boolean hasContentOnly,
      boolean displayOnly, boolean cacheable, int pageNo, int pageSize) {
    Finder f = getChildFinder(parentId, hasContentOnly, displayOnly,
        cacheable);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

    return find(f, pageNo, pageSize);
  }

  private Finder getChildFinder(Integer parentId, boolean hasContentOnly,
      boolean displayOnly, boolean cacheable) {
    Finder f = Finder.create("from Channel bean");
    f.append(" where bean.parent.id=:parentId");
    f.setParam("parentId", parentId);
    if (hasContentOnly) {
      f.append(" and bean.hasContent=true");
    }
    if (displayOnly) {
      f.append(" and bean.display=true");
    }
    f.append(" order by bean.priority asc,bean.id asc");
    return f;
  }
View Full Code Here

@Repository
public class ContentTypeDaoImpl extends HibernateBaseDao<ContentType, Integer>
    implements ContentTypeDao {
  @SuppressWarnings("unchecked")
  public List<ContentType> getList(boolean containDisabled) {
    Finder f = Finder.create("from ContentType bean");
    if (!containDisabled) {
      f.append(" where bean.disabled=false");
    }
    f.append(" order by bean.id asc");
    return find(f);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public List<Channel> getChildListByRight(Integer userId, Integer parentId,
      boolean hasContentOnly) {
    Finder f = Finder.create("select bean from Channel bean");
    f.append(" join bean.users user");
    f.append(" where user.id=:userId and bean.parent.id=:parentId");
    f.setParam("userId", userId).setParam("parentId", parentId);
    if (hasContentOnly) {
      f.append(" and bean.hasContent=true");
    }
    f.append(" order by bean.priority asc,bean.id asc");
    return find(f);
  }
View Full Code Here

    Query query = f.createQuery(getSession());
    query.executeUpdate();
  }

  public long flowAnalysisTotal(Integer siteId) {
    Finder f = createCacheableFinder("select count(*) from CmsSiteFlow bean where bean.site.id=:siteId");
    f.setParam("siteId", siteId);
    return (Long) find(f).iterator().next();
  }
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.