Package com.jeecms.common.hibernate3

Examples of com.jeecms.common.hibernate3.TreeIntercptor


    return (Long) find(f).iterator().next();
  }

  public long commentStatistic(TimeRange timeRange,
      Map<String, Object> restrictions) {
    Finder f = createCacheableFinder("select count(*) from CmsComment bean where bean.site.id=:siteId");
    f.setParam("siteId", restrictions.get(SITEID));
    if (timeRange != null) {
      f.append(" and bean.createTime >= :begin");
      f.append(" and bean.createTime < :end");
      f.setParam("begin", timeRange.getBegin());
      f.setParam("end", timeRange.getEnd());
    }
    Boolean isReplyed = (Boolean) restrictions.get(ISREPLYED);
    if (isReplyed != null) {
      if (isReplyed) {
        f.append(" and bean.replayTime is not null");
      } else {
        f.append(" and bean.replayTime is null");
      }
    }
    return (Long) find(f).iterator().next();
  }
View Full Code Here


    return (Long) find(f).iterator().next();
  }

  public long guestbookStatistic(TimeRange timeRange,
      Map<String, Object> restrictions) {
    Finder f = createCacheableFinder("select count(*) from CmsGuestbook bean where bean.site.id=:siteId");
    f.setParam("siteId", restrictions.get(SITEID));
    if (timeRange != null) {
      f.append(" and bean.createTime >= :begin");
      f.append(" and bean.createTime < :end");
      f.setParam("begin", timeRange.getBegin());
      f.setParam("end", timeRange.getEnd());
    }
    Boolean isReplyed = (Boolean) restrictions.get(ISREPLYED);
    if (isReplyed != null) {
      if (isReplyed) {
        f.append(" and bean.replayTime is not null");
      } else {
        f.append(" and bean.replayTime is null");
      }
    }
    return (Long) find(f).iterator().next();
  }
View Full Code Here

    return (Long) find(f).iterator().next();
  }

  @SuppressWarnings("unchecked")
  public List<Object[]> getPvCountByGroup(Integer siteId) {
    Finder f = createCacheableFinder("select count(*),bean.accessDate from CmsSiteFlow bean where bean.site.id=:siteId group by bean.accessDate");
    f.setParam("siteId", siteId);
    return find(f);
  }
View Full Code Here

    f.setParam("siteId", siteId);
    return find(f);
  }

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

    return getPvCountByTimeRange(siteId, null);
  }

  @SuppressWarnings("unchecked")
  public List<Object[]> getUniqueIpCountByGroup(Integer siteId) {
    Finder f = createCacheableFinder("select count(distinct bean.accessIp),bean.accessDate from CmsSiteFlow bean where bean.site.id=:siteId group by bean.accessDate");
    f.setParam("siteId", siteId);
    return find(f);
  }
View Full Code Here

public class ChannelDaoImpl extends HibernateBaseDao<Channel, Integer>
    implements ChannelDao {
  @SuppressWarnings("unchecked")
  public List<Channel> getTopList(Integer siteId, boolean hasContentOnly,
      boolean displayOnly, boolean cacheable) {
    Finder f = getTopFinder(siteId, hasContentOnly, displayOnly, cacheable);
    return find(f);
  }
View Full Code Here

    return find(f);
  }

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

    f.setParam("siteId", siteId);
    return find(f);
  }

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

    return find(f, pageNo, pageSize);
  }

  private Finder getTopFinder(Integer siteId, boolean hasContentOnly,
      boolean displayOnly, boolean cacheable) {
    Finder f = Finder.create("from Channel bean");
    f.append(" where bean.site.id=:siteId and bean.parent.id is null");
    f.setParam("siteId", siteId);
    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");
    f.setCacheable(cacheable);
    return f;
  }
View Full Code Here

    return getUniqueIpCountByTimeRange(siteId, null);
  }

  @SuppressWarnings("unchecked")
  public List<Object[]> getUniqueVisitorCountByGroup(Integer siteId) {
    Finder f = createCacheableFinder("select count(distinct bean.sessionId),bean.accessDate from CmsSiteFlow bean where bean.site.id=:siteId group by bean.accessDate");
    f.setParam("siteId", siteId);
    return find(f);
  }
View Full Code Here

TOP

Related Classes of com.jeecms.common.hibernate3.TreeIntercptor

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.