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

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


    return findByGroupId(groupId, begin, end, null);
  }

  protected List findByGroupId(String groupId, int begin, int end,
    OrderByComparator obc) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("groupId = ?");
      query.append(" ");

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

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

      List list = new ArrayList();
View Full Code Here


  protected com.liferay.portal.model.Portlet[] findByGroupId_PrevAndNext(
    PortletPK portletPK, String groupId, OrderByComparator obc)
    throws NoSuchPortletException, SystemException {
    com.liferay.portal.model.Portlet portlet = findByPrimaryKey(portletPK);
    int count = countByGroupId(groupId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("groupId = ?");
      query.append(" ");

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

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

      com.liferay.portal.model.Portlet[] array = new com.liferay.portal.model.Portlet[3];
      ScrollableResults sr = q.scroll();
View Full Code Here

      HibernateUtil.closeSession(session);
    }
  }

  protected List findByCompanyId(String companyId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("companyId = ?");
      query.append(" ");

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

      Iterator itr = q.list().iterator();
      List list = new ArrayList();
View Full Code Here

    return findByCompanyId(companyId, begin, end, null);
  }

  protected List findByCompanyId(String companyId, int begin, int end,
    OrderByComparator obc) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("companyId = ?");
      query.append(" ");

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

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

      List list = new ArrayList();
View Full Code Here

  protected com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
    PortletPK portletPK, String companyId, OrderByComparator obc)
    throws NoSuchPortletException, SystemException {
    com.liferay.portal.model.Portlet portlet = findByPrimaryKey(portletPK);
    int count = countByCompanyId(companyId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("companyId = ?");
      query.append(" ");

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

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

      com.liferay.portal.model.Portlet[] array = new com.liferay.portal.model.Portlet[3];
      ScrollableResults sr = q.scroll();
View Full Code Here

    }
  }

  protected List findByG_C(String groupId, String companyId)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("groupId = ?");
      query.append(" AND ");
      query.append("companyId = ?");
      query.append(" ");

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

      Iterator itr = q.list().iterator();
View Full Code Here

    return findByG_C(groupId, companyId, begin, end, null);
  }

  protected List findByG_C(String groupId, String companyId, int begin,
    int end, OrderByComparator obc) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("groupId = ?");
      query.append(" AND ");
      query.append("companyId = ?");
      query.append(" ");

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

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

      List list = new ArrayList();
View Full Code Here

  protected com.liferay.portal.model.Portlet[] findByG_C_PrevAndNext(
    PortletPK portletPK, String groupId, String companyId,
    OrderByComparator obc) throws NoSuchPortletException, SystemException {
    com.liferay.portal.model.Portlet portlet = findByPrimaryKey(portletPK);
    int count = countByG_C(groupId, companyId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("groupId = ?");
      query.append(" AND ");
      query.append("companyId = ?");
      query.append(" ");

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

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

      com.liferay.portal.model.Portlet[] array = new com.liferay.portal.model.Portlet[3];
View Full Code Here

      HibernateUtil.closeSession(session);
    }
  }

  protected List findAll() throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM ");

      Iterator itr = session.find(query.toString()).iterator();
      List list = new ArrayList();

      while (itr.hasNext()) {
        PortletHBM portletHBM = (PortletHBM)itr.next();
        list.add(PortletHBMUtil.model(portletHBM));
View Full Code Here

      HibernateUtil.closeSession(session);
    }
  }

  protected void removeByGroupId(String groupId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM Portlet IN CLASS com.liferay.portal.ejb.PortletHBM WHERE ");
      query.append("groupId = ?");
      query.append(" ");

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

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

      while (itr.hasNext()) {
        PortletHBM portletHBM = (PortletHBM)itr.next();
        PortletPool.remove((PortletPK)portletHBM.getPrimaryKey());
        session.delete(portletHBM);
      }

      session.flush();
    }
    catch (HibernateException he) {
      throw new SystemException(he);
    }
    finally {
View Full Code Here

TOP

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

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.