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

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


  }

  protected com.liferay.portal.model.UserTrackerPath update(
    com.liferay.portal.model.UserTrackerPath userTrackerPath)
    throws SystemException {
    Session session = null;

    try {
      if (userTrackerPath.isNew() || userTrackerPath.isModified()) {
        session = openSession();

        if (userTrackerPath.isNew()) {
          UserTrackerPathHBM userTrackerPathHBM = new UserTrackerPathHBM(userTrackerPath.getUserTrackerPathId(),
              userTrackerPath.getUserTrackerId(),
              userTrackerPath.getPath(),
              userTrackerPath.getPathDate());
          session.save(userTrackerPathHBM);
          session.flush();
        }
        else {
          try {
            UserTrackerPathHBM userTrackerPathHBM = (UserTrackerPathHBM)session.load(UserTrackerPathHBM.class,
                userTrackerPath.getPrimaryKey());
            userTrackerPathHBM.setUserTrackerId(userTrackerPath.getUserTrackerId());
            userTrackerPathHBM.setPath(userTrackerPath.getPath());
            userTrackerPathHBM.setPathDate(userTrackerPath.getPathDate());
            session.flush();
          }
          catch (ObjectNotFoundException onfe) {
            UserTrackerPathHBM userTrackerPathHBM = new UserTrackerPathHBM(userTrackerPath.getUserTrackerPathId(),
                userTrackerPath.getUserTrackerId(),
                userTrackerPath.getPath(),
                userTrackerPath.getPathDate());
            session.save(userTrackerPathHBM);
            session.flush();
          }
        }

        userTrackerPath.setNew(false);
        userTrackerPath.setModified(false);
View Full Code Here


    return new com.liferay.portlet.polls.model.PollsVote(pollsVotePK);
  }

  protected com.liferay.portlet.polls.model.PollsVote remove(
    PollsVotePK pollsVotePK) throws NoSuchVoteException, SystemException {
    Session session = null;

    try {
      session = openSession();

      PollsVoteHBM pollsVoteHBM = (PollsVoteHBM)session.load(PollsVoteHBM.class,
          pollsVotePK);
      com.liferay.portlet.polls.model.PollsVote pollsVote = PollsVoteHBMUtil.model(pollsVoteHBM);
      session.delete(pollsVoteHBM);
      session.flush();
      PollsVotePool.remove(pollsVotePK);

      return pollsVote;
    }
    catch (HibernateException he) {
View Full Code Here

  }

  protected com.liferay.portlet.polls.model.PollsVote update(
    com.liferay.portlet.polls.model.PollsVote pollsVote)
    throws SystemException {
    Session session = null;

    try {
      if (pollsVote.isNew() || pollsVote.isModified()) {
        session = openSession();

        if (pollsVote.isNew()) {
          PollsVoteHBM pollsVoteHBM = new PollsVoteHBM(pollsVote.getQuestionId(),
              pollsVote.getUserId(), pollsVote.getChoiceId(),
              pollsVote.getVoteDate());
          session.save(pollsVoteHBM);
          session.flush();
        }
        else {
          try {
            PollsVoteHBM pollsVoteHBM = (PollsVoteHBM)session.load(PollsVoteHBM.class,
                pollsVote.getPrimaryKey());
            pollsVoteHBM.setChoiceId(pollsVote.getChoiceId());
            pollsVoteHBM.setVoteDate(pollsVote.getVoteDate());
            session.flush();
          }
          catch (ObjectNotFoundException onfe) {
            PollsVoteHBM pollsVoteHBM = new PollsVoteHBM(pollsVote.getQuestionId(),
                pollsVote.getUserId(), pollsVote.getChoiceId(),
                pollsVote.getVoteDate());
            session.save(pollsVoteHBM);
            session.flush();
          }
        }

        pollsVote.setNew(false);
        pollsVote.setModified(false);
View Full Code Here

  }

  protected com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
    PollsVotePK pollsVotePK) throws NoSuchVoteException, SystemException {
    com.liferay.portlet.polls.model.PollsVote pollsVote = PollsVotePool.get(pollsVotePK);
    Session session = null;

    try {
      if (pollsVote == null) {
        session = openSession();

        PollsVoteHBM pollsVoteHBM = (PollsVoteHBM)session.load(PollsVoteHBM.class,
            pollsVotePK);
        pollsVote = PollsVoteHBMUtil.model(pollsVoteHBM);
      }

      return pollsVote;
View Full Code Here

    }
  }

  protected List findByQuestionId(String questionId)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM PollsVote IN CLASS com.liferay.portlet.polls.ejb.PollsVoteHBM WHERE ");
      query.append("questionId = ?");
      query.append(" ");

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

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

    return findByQuestionId(questionId, begin, end, null);
  }

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

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM PollsVote IN CLASS com.liferay.portlet.polls.ejb.PollsVoteHBM WHERE ");
      query.append("questionId = ?");
      query.append(" ");

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

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

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

  protected com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
    PollsVotePK pollsVotePK, String questionId, OrderByComparator obc)
    throws NoSuchVoteException, SystemException {
    com.liferay.portlet.polls.model.PollsVote pollsVote = findByPrimaryKey(pollsVotePK);
    int count = countByQuestionId(questionId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM PollsVote IN CLASS com.liferay.portlet.polls.ejb.PollsVoteHBM WHERE ");
      query.append("questionId = ?");
      query.append(" ");

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

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

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

    }
  }

  protected List findByQ_C(String questionId, String choiceId)
    throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM PollsVote IN CLASS com.liferay.portlet.polls.ejb.PollsVoteHBM WHERE ");
      query.append("questionId = ?");
      query.append(" AND ");
      query.append("choiceId = ?");
      query.append(" ");

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

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

    return findByQ_C(questionId, choiceId, begin, end, null);
  }

  protected List findByQ_C(String questionId, String choiceId, int begin,
    int end, OrderByComparator obc) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM PollsVote IN CLASS com.liferay.portlet.polls.ejb.PollsVoteHBM WHERE ");
      query.append("questionId = ?");
      query.append(" AND ");
      query.append("choiceId = ?");
      query.append(" ");

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

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

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

  protected com.liferay.portlet.polls.model.PollsVote[] findByQ_C_PrevAndNext(
    PollsVotePK pollsVotePK, String questionId, String choiceId,
    OrderByComparator obc) throws NoSuchVoteException, SystemException {
    com.liferay.portlet.polls.model.PollsVote pollsVote = findByPrimaryKey(pollsVotePK);
    int count = countByQ_C(questionId, choiceId);
    Session session = null;

    try {
      session = openSession();

      StringBuffer query = new StringBuffer();
      query.append(
        "FROM PollsVote IN CLASS com.liferay.portlet.polls.ejb.PollsVoteHBM WHERE ");
      query.append("questionId = ?");
      query.append(" AND ");
      query.append("choiceId = ?");
      query.append(" ");

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

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

      com.liferay.portlet.polls.model.PollsVote[] array = new com.liferay.portlet.polls.model.PollsVote[3];
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.