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

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


  protected com.liferay.portal.model.UserTracker[] findByCompanyId_PrevAndNext(
    String userTrackerId, String companyId, OrderByComparator obc)
    throws NoSuchUserTrackerException, SystemException {
    com.liferay.portal.model.UserTracker userTracker = findByPrimaryKey(userTrackerId);
    int count = countByCompanyId(companyId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM 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.UserTracker[] array = new com.liferay.portal.model.UserTracker[3];
      ScrollableResults sr = q.scroll();
View Full Code Here


      HibernateUtil.closeSession(session);
    }
  }

  protected List findByUserId(String userId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM 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();
View Full Code Here

    return findByUserId(userId, begin, end, null);
  }

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

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");

      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();
View Full Code Here

  protected com.liferay.portal.model.UserTracker[] findByUserId_PrevAndNext(
    String userTrackerId, String userId, OrderByComparator obc)
    throws NoSuchUserTrackerException, SystemException {
    com.liferay.portal.model.UserTracker userTracker = findByPrimaryKey(userTrackerId);
    int count = countByUserId(userId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");

      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.UserTracker[] array = new com.liferay.portal.model.UserTracker[3];
      ScrollableResults sr = q.scroll();
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 UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM ");

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

      while (itr.hasNext()) {
        UserTrackerHBM userTrackerHBM = (UserTrackerHBM)itr.next();
        list.add(UserTrackerHBMUtil.model(userTrackerHBM));
View Full Code Here

    }
  }

  protected void removeByCompanyId(String companyId)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

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

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

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

      while (itr.hasNext()) {
        UserTrackerHBM userTrackerHBM = (UserTrackerHBM)itr.next();
        UserTrackerPool.remove((String)userTrackerHBM.getPrimaryKey());
        session.delete(userTrackerHBM);
      }

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

      HibernateUtil.closeSession(session);
    }
  }

  protected void removeByUserId(String userId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");

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

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

      while (itr.hasNext()) {
        UserTrackerHBM userTrackerHBM = (UserTrackerHBM)itr.next();
        UserTrackerPool.remove((String)userTrackerHBM.getPrimaryKey());
        session.delete(userTrackerHBM);
      }

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

      HibernateUtil.closeSession(session);
    }
  }

  protected int countByCompanyId(String companyId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append("SELECT COUNT(*) ");
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");
      query.append("companyId = ?");
      query.append(" ");

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

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

View Full Code Here

      HibernateUtil.closeSession(session);
    }
  }

  protected int countByUserId(String userId) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append("SELECT COUNT(*) ");
      query.append(
        "FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");
      query.append("userId = ?");
      query.append(" ");

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

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

View Full Code Here

  }

  protected com.liferay.portal.model.UserTrackerPath remove(
    String userTrackerPathId)
    throws NoSuchUserTrackerPathException, SystemException {
    Session session = null;

    try {
      session = openSession();

      UserTrackerPathHBM userTrackerPathHBM = (UserTrackerPathHBM)session.load(UserTrackerPathHBM.class,
          userTrackerPathId);
      com.liferay.portal.model.UserTrackerPath userTrackerPath = UserTrackerPathHBMUtil.model(userTrackerPathHBM);
      session.delete(userTrackerPathHBM);
      session.flush();
      UserTrackerPathPool.remove(userTrackerPathId);

      return userTrackerPath;
    }
    catch (HibernateException he) {
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.