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

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


          PollsChoiceHBM pollsChoiceHBM = (PollsChoiceHBM)itr.next();
          list.add(PollsChoiceHBMUtil.model(pollsChoiceHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            PollsChoiceHBM pollsChoiceHBM = (PollsChoiceHBM)sr.get(0);
            list.add(PollsChoiceHBMUtil.model(pollsChoiceHBM));

            if (!sr.next()) {
              break;
            }
          }
        }
      }
View Full Code Here


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

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

      if (sr.first()) {
        while (true) {
          PollsChoiceHBM pollsChoiceHBM = (PollsChoiceHBM)sr.get(0);

          if (pollsChoiceHBM == null) {
            break;
          }

          com.liferay.portlet.polls.model.PollsChoice curPollsChoice = PollsChoiceHBMUtil.model(pollsChoiceHBM);
          int value = obc.compare(pollsChoice, curPollsChoice);

          if (value == 0) {
            if (!pollsChoice.equals(curPollsChoice)) {
              break;
            }

            array[1] = curPollsChoice;

            if (sr.previous()) {
              array[0] = PollsChoiceHBMUtil.model((PollsChoiceHBM)sr.get(
                    0));
            }

            sr.next();

            if (sr.next()) {
              array[2] = PollsChoiceHBMUtil.model((PollsChoiceHBM)sr.get(
                    0));
            }

            break;
          }

          if (count == 1) {
            break;
          }

          count = (int)Math.ceil(count / 2.0);

          if (value < 0) {
            if (!sr.scroll(count * -1)) {
              break;
            }
          }
          else {
            if (!sr.scroll(count)) {
              break;
            }
          }
        }
      }
View Full Code Here

TOP

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

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.