Package org.apache.openejb

Examples of org.apache.openejb.Extensions$Finder


@Repository
public class CmsVoteTopicDaoImpl extends
    HibernateBaseDao<CmsVoteTopic, Integer> implements CmsVoteTopicDao {
  public Pagination getPage(Integer siteId, int pageNo, int pageSize) {
    Finder f = Finder.create("from CmsVoteTopic bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    f.append(" order by bean.id desc");
    return find(f, pageNo, pageSize);
  }
View Full Code Here


    f.append(" order by bean.id desc");
    return find(f, pageNo, pageSize);
  }

  public CmsVoteTopic getDefTopic(Integer siteId) {
    Finder f = Finder.create("from CmsVoteTopic bean where 1=1");
    if (siteId != null) {
      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();
  }
View Full Code Here

public class CmsAcquisitionHistoryDaoImpl extends
    HibernateBaseDao<CmsAcquisitionHistory, Integer> implements
    CmsAcquisitionHistoryDao {
  @SuppressWarnings("unchecked")
  public List<CmsAcquisitionHistory> getList(Integer siteId, Integer acquId) {
    Finder f = Finder.create("from CmsAcquisitionHistory bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.acquisition.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if (acquId != null) {
      f.append(" and bean.acquisition.id=:acquId");
      f.setParam("acquId", acquId);
    }
    f.append(" order by bean.id asc");
    return find(f);
  }
View Full Code Here

    return find(f);
  }

  public Pagination getPage(Integer siteId, Integer acquId, Integer pageNo,
      Integer pageSize) {
    Finder f = Finder.create("from CmsAcquisitionHistory bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.acquisition.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if (acquId != null) {
      f.append(" and bean.acquisition.id=:acquId");
      f.setParam("acquId", acquId);
    }
    f.append(" order by bean.id desc");
    return find(f, pageNo, pageSize);
  }
View Full Code Here

@Repository
public class CmsAcquisitionDaoImpl extends
    HibernateBaseDao<CmsAcquisition, Integer> implements CmsAcquisitionDao {
  @SuppressWarnings("unchecked")
  public List<CmsAcquisition> getList(Integer siteId) {
    Finder f = Finder.create("from CmsAcquisition bean");
    if (siteId != null) {
      f.append(" where bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    f.append(" order by bean.id asc");
    return find(f);
  }
View Full Code Here

    return ((Number) query.iterate().next()).intValue();
  }

  @SuppressWarnings("unchecked")
  public List<CmsAcquisition> getLargerQueues(Integer siteId, Integer queueNum) {
    Finder f = Finder.create("from CmsAcquisition bean where bean.queue>:queueNum and bean.site.id=:siteId")
        .setParam("queueNum", queueNum)
        .setParam("siteId", siteId);
    return find(f);
  }
View Full Code Here

public class CmsAdvertisingSpaceDaoImpl extends
    HibernateBaseDao<CmsAdvertisingSpace, Integer> implements
    CmsAdvertisingSpaceDao {
  @SuppressWarnings("unchecked")
  public List<CmsAdvertisingSpace> getList(Integer siteId) {
    Finder f = Finder.create("from CmsAdvertisingSpace bean");
    if (siteId != null) {
      f.append(" where bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    return find(f);
  }
View Full Code Here

public class CmsGuestbookDaoImpl extends
    HibernateBaseDao<CmsGuestbook, Integer> implements CmsGuestbookDao {
  public Pagination getPage(Integer siteId, Integer ctgId,Integer userId,Boolean recommend,
      Boolean checked, boolean asc, boolean cacheable, int pageNo,
      int pageSize) {
    Finder f = createFinder(siteId, ctgId, userId,recommend, checked, asc,
        cacheable);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<CmsGuestbook> getList(Integer siteId, Integer ctgId,
      Boolean recommend, Boolean checked, boolean desc,
      boolean cacheable, int first, int max) {
    Finder f = createFinder(siteId, ctgId, null,recommend, checked, desc,
        cacheable);
    f.setFirstResult(first);
    f.setMaxResults(max);
    return find(f);
  }
View Full Code Here

    return find(f);
  }

  private Finder createFinder(Integer siteId, Integer ctgId,Integer userId,
      Boolean recommend, Boolean checked, boolean desc, boolean cacheable) {
    Finder f = Finder.create("from CmsGuestbook bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if (ctgId != null) {
      f.append(" and bean.ctg.id=:ctgId");
      f.setParam("ctgId", ctgId);
    }
    if (userId != null) {
      f.append(" and bean.member.id=:userId");
      f.setParam("userId", userId);
    }
    if (recommend != null) {
      f.append(" and bean.recommend=:recommend");
      f.setParam("recommend", recommend);
    }
    if (checked != null) {
      f.append(" and bean.checked=:checked");
      f.setParam("checked", checked);
    }
    if (desc) {
      f.append(" order by bean.id desc");
    } else {
      f.append(" order by bean.id asc");
    }
    f.setCacheable(cacheable);
    return 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.