Package com.dotcms.repackage.net.sf.hibernate

Examples of com.dotcms.repackage.net.sf.hibernate.Query


      query.append("groupId = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("createDate DESC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, groupId);

      Iterator itr = q.list().iterator();
      List list = new ArrayList();

      while (itr.hasNext()) {
        PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)itr.next();
        list.add(PollsQuestionHBMUtil.model(pollsQuestionHBM));
View Full Code Here


      else {
        query.append("ORDER BY ");
        query.append("createDate DESC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, groupId);

      List list = new ArrayList();

      if (getDialect().supportsLimit()) {
        q.setMaxResults(end - begin);
        q.setFirstResult(begin);

        Iterator itr = q.list().iterator();

        while (itr.hasNext()) {
          PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)itr.next();
          list.add(PollsQuestionHBMUtil.model(pollsQuestionHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)sr.get(0);
            list.add(PollsQuestionHBMUtil.model(pollsQuestionHBM));
View Full Code Here

      else {
        query.append("ORDER BY ");
        query.append("createDate DESC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, groupId);

      com.liferay.portlet.polls.model.PollsQuestion[] array = new com.liferay.portlet.polls.model.PollsQuestion[3];
      ScrollableResults sr = q.scroll();

      if (sr.first()) {
        while (true) {
          PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)sr.get(0);
View Full Code Here

      query.append("companyId = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("createDate DESC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, portletId);
      q.setString(queryPos++, companyId);

      Iterator itr = q.list().iterator();
      List list = new ArrayList();

      while (itr.hasNext()) {
        PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)itr.next();
        list.add(PollsQuestionHBMUtil.model(pollsQuestionHBM));
View Full Code Here

      else {
        query.append("ORDER BY ");
        query.append("createDate DESC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, portletId);
      q.setString(queryPos++, companyId);

      List list = new ArrayList();

      if (getDialect().supportsLimit()) {
        q.setMaxResults(end - begin);
        q.setFirstResult(begin);

        Iterator itr = q.list().iterator();

        while (itr.hasNext()) {
          PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)itr.next();
          list.add(PollsQuestionHBMUtil.model(pollsQuestionHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)sr.get(0);
            list.add(PollsQuestionHBMUtil.model(pollsQuestionHBM));
View Full Code Here

      else {
        query.append("ORDER BY ");
        query.append("createDate DESC");
      }

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, portletId);
      q.setString(queryPos++, companyId);

      com.liferay.portlet.polls.model.PollsQuestion[] array = new com.liferay.portlet.polls.model.PollsQuestion[3];
      ScrollableResults sr = q.scroll();

      if (sr.first()) {
        while (true) {
          PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)sr.get(0);
View Full Code Here

      query.append("groupId = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("createDate DESC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, groupId);

      Iterator itr = q.list().iterator();

      while (itr.hasNext()) {
        PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)itr.next();
        PollsQuestionPool.remove((String)pollsQuestionHBM.getPrimaryKey());
        session.delete(pollsQuestionHBM);
View Full Code Here

      query.append("companyId = ?");
      query.append(" ");
      query.append("ORDER BY ");
      query.append("createDate DESC");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, portletId);
      q.setString(queryPos++, groupId);
      q.setString(queryPos++, companyId);

      Iterator itr = q.list().iterator();

      while (itr.hasNext()) {
        PollsQuestionHBM pollsQuestionHBM = (PollsQuestionHBM)itr.next();
        PollsQuestionPool.remove((String)pollsQuestionHBM.getPrimaryKey());
        session.delete(pollsQuestionHBM);
View Full Code Here

      query.append(
        "FROM PollsQuestion IN CLASS com.liferay.portlet.polls.ejb.PollsQuestionHBM WHERE ");
      query.append("groupId = ?");
      query.append(" ");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, groupId);

      Iterator itr = q.list().iterator();

      if (itr.hasNext()) {
        Integer count = (Integer)itr.next();

        if (count != null) {
View Full Code Here

      query.append("portletId = ?");
      query.append(" AND ");
      query.append("companyId = ?");
      query.append(" ");

      Query q = session.createQuery(query.toString());
      int queryPos = 0;
      q.setString(queryPos++, portletId);
      q.setString(queryPos++, companyId);

      Iterator itr = q.list().iterator();

      if (itr.hasNext()) {
        Integer count = (Integer)itr.next();

        if (count != null) {
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.net.sf.hibernate.Query

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.