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

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


          PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)itr.next();
          list.add(PollsDisplayHBMUtil.model(pollsDisplayHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)sr.get(0);
            list.add(PollsDisplayHBMUtil.model(pollsDisplayHBM));

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


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

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

      if (sr.first()) {
        while (true) {
          PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)sr.get(0);

          if (pollsDisplayHBM == null) {
            break;
          }

          com.liferay.portlet.polls.model.PollsDisplay curPollsDisplay =
            PollsDisplayHBMUtil.model(pollsDisplayHBM);
          int value = obc.compare(pollsDisplay, curPollsDisplay);

          if (value == 0) {
            if (!pollsDisplay.equals(curPollsDisplay)) {
              break;
            }

            array[1] = curPollsDisplay;

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

            sr.next();

            if (sr.next()) {
              array[2] = PollsDisplayHBMUtil.model((PollsDisplayHBM)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

          PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)itr.next();
          list.add(PollsDisplayHBMUtil.model(pollsDisplayHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)sr.get(0);
            list.add(PollsDisplayHBMUtil.model(pollsDisplayHBM));

            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.PollsDisplay[] array = new com.liferay.portlet.polls.model.PollsDisplay[3];
      ScrollableResults sr = q.scroll();

      if (sr.first()) {
        while (true) {
          PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)sr.get(0);

          if (pollsDisplayHBM == null) {
            break;
          }

          com.liferay.portlet.polls.model.PollsDisplay curPollsDisplay =
            PollsDisplayHBMUtil.model(pollsDisplayHBM);
          int value = obc.compare(pollsDisplay, curPollsDisplay);

          if (value == 0) {
            if (!pollsDisplay.equals(curPollsDisplay)) {
              break;
            }

            array[1] = curPollsDisplay;

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

            sr.next();

            if (sr.next()) {
              array[2] = PollsDisplayHBMUtil.model((PollsDisplayHBM)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

          PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)itr.next();
          list.add(PollsDisplayHBMUtil.model(pollsDisplayHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)sr.get(0);
            list.add(PollsDisplayHBMUtil.model(pollsDisplayHBM));

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

      int queryPos = 0;
      q.setString(queryPos++, layoutId);
      q.setString(queryPos++, userId);

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

      if (sr.first()) {
        while (true) {
          PollsDisplayHBM pollsDisplayHBM = (PollsDisplayHBM)sr.get(0);

          if (pollsDisplayHBM == null) {
            break;
          }

          com.liferay.portlet.polls.model.PollsDisplay curPollsDisplay =
            PollsDisplayHBMUtil.model(pollsDisplayHBM);
          int value = obc.compare(pollsDisplay, curPollsDisplay);

          if (value == 0) {
            if (!pollsDisplay.equals(curPollsDisplay)) {
              break;
            }

            array[1] = curPollsDisplay;

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

            sr.next();

            if (sr.next()) {
              array[2] = PollsDisplayHBMUtil.model((PollsDisplayHBM)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

          UserHBM userHBM = (UserHBM)itr.next();
          list.add(UserHBMUtil.model(userHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            UserHBM userHBM = (UserHBM)sr.get(0);
            list.add(UserHBMUtil.model(userHBM));

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

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

      com.liferay.portal.model.User[] array = new com.liferay.portal.model.User[3];
      ScrollableResults sr = q.scroll();

      if (sr.first()) {
        while (true) {
          UserHBM userHBM = (UserHBM)sr.get(0);

          if (userHBM == null) {
            break;
          }

          com.liferay.portal.model.User curUser = UserHBMUtil.model(userHBM);
          int value = obc.compare(user, curUser);

          if (value == 0) {
            if (!user.equals(curUser)) {
              break;
            }

            array[1] = curUser;

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

            sr.next();

            if (sr.next()) {
              array[2] = UserHBMUtil.model((UserHBM)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

          UserHBM userHBM = (UserHBM)itr.next();
          list.add(UserHBMUtil.model(userHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

        if (sr.first() && sr.scroll(begin)) {
          for (int i = begin; i < end; i++) {
            UserHBM userHBM = (UserHBM)sr.get(0);
            list.add(UserHBMUtil.model(userHBM));

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

      int queryPos = 0;
      q.setString(queryPos++, companyId);
      q.setString(queryPos++, password);

      com.liferay.portal.model.User[] array = new com.liferay.portal.model.User[3];
      ScrollableResults sr = q.scroll();

      if (sr.first()) {
        while (true) {
          UserHBM userHBM = (UserHBM)sr.get(0);

          if (userHBM == null) {
            break;
          }

          com.liferay.portal.model.User curUser = UserHBMUtil.model(userHBM);
          int value = obc.compare(user, curUser);

          if (value == 0) {
            if (!user.equals(curUser)) {
              break;
            }

            array[1] = curUser;

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

            sr.next();

            if (sr.next()) {
              array[2] = UserHBMUtil.model((UserHBM)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.