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

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


      query.append(
        "FROM PortletPreferences IN CLASS com.liferay.portal.ejb.PortletPreferencesHBM WHERE ");
      query.append("layoutId = ?");
      query.append(" ");

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

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

      while (itr.hasNext()) {
        PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
        list.add(PortletPreferencesHBMUtil.model(portletPreferencesHBM));
View Full Code Here


      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }

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

      List list = new ArrayList();

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

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

        while (itr.hasNext()) {
          PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
          list.add(PortletPreferencesHBMUtil.model(
              portletPreferencesHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

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

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }

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

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

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

      query.append(
        "FROM PortletPreferences IN CLASS com.liferay.portal.ejb.PortletPreferencesHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");

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

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

      while (itr.hasNext()) {
        PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
        list.add(PortletPreferencesHBMUtil.model(portletPreferencesHBM));
View Full Code Here

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }

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

      List list = new ArrayList();

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

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

        while (itr.hasNext()) {
          PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
          list.add(PortletPreferencesHBMUtil.model(
              portletPreferencesHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

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

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }

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

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

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

      query.append("layoutId = ?");
      query.append(" AND ");
      query.append("userId = ?");
      query.append(" ");

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

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

      while (itr.hasNext()) {
        PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
        list.add(PortletPreferencesHBMUtil.model(portletPreferencesHBM));
View Full Code Here

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }

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

      List list = new ArrayList();

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

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

        while (itr.hasNext()) {
          PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
          list.add(PortletPreferencesHBMUtil.model(
              portletPreferencesHBM));
        }
      }
      else {
        ScrollableResults sr = q.scroll();

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

      if (obc != null) {
        query.append("ORDER BY " + obc.getOrderBy());
      }

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

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

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

      query.append(
        "FROM PortletPreferences IN CLASS com.liferay.portal.ejb.PortletPreferencesHBM WHERE ");
      query.append("layoutId = ?");
      query.append(" ");

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

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

      while (itr.hasNext()) {
        PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM)itr.next();
        PortletPreferencesPool.remove((PortletPreferencesPK)portletPreferencesHBM.getPrimaryKey());
        session.delete(portletPreferencesHBM);
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.