Package com.jeecms.common.hibernate3

Examples of com.jeecms.common.hibernate3.Finder.createQuery()


    }
    if (before != null) {
      f.append(" and bean.time<=:before");
      f.setParam("before", before);
    }
    Query q = f.createQuery(getSession());
    return q.executeUpdate();
  }

  @Override
  protected Class<CmsLog> getEntityClass() {
View Full Code Here


      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();
  }

  @SuppressWarnings("unchecked")
View Full Code Here

    f.append(" order by bean.id asc");
    if (max != null) {
      f.setMaxResults(max);
    }
    Session session = getSession();
    ScrollableResults contents = f.createQuery(getSession()).setCacheMode(
        CacheMode.IGNORE).scroll(ScrollMode.FORWARD_ONLY);
    int count = 0;
    Content content = null;
    while (contents.next()) {
      content = (Content) contents.get(0);
View Full Code Here

    }
    if (endDate != null) {
      f.append(" and bean.accessTime <= :endDate");
      f.setParam("endDate", endDate);
    }
    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");
View Full Code Here

    } else if (siteId != null) {
      finder.append(" where bean.site.id=:siteId");
      finder.setParam("siteId", siteId);
    }
    Session session = getSession();
    ScrollableResults channels = finder.createQuery(session).setCacheMode(
        CacheMode.IGNORE).scroll(ScrollMode.FORWARD_ONLY);
    int count = 0;
    CmsSite site;
    Channel c;
    PageInfo info;
View Full Code Here

      f.append(" and bean.sortDate>=:start");
      f.setParam("start", start);
    }
    f.append(" and bean.status=" + ContentCheck.CHECKED);
    Session session = getSession();
    ScrollableResults contents = f.createQuery(session).setCacheMode(
        CacheMode.IGNORE).scroll(ScrollMode.FORWARD_ONLY);
    int count = 0;
    int totalPage;
    String url, real;
    File file, parent;
View Full Code Here

      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    f.append(" and bean.def=true");
    f.setMaxResults(1);
    return (CmsVoteTopic) f.createQuery(getSession()).uniqueResult();
  }

  public CmsVoteTopic findById(Integer id) {
    CmsVoteTopic entity = get(id);
    return entity;
View Full Code Here

TOP
Copyright © 2015 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.