Exemplo n.º 1
0
  protected static com.liferay.portlet.polls.model.PollsDisplay remove(
      com.liferay.portlet.polls.ejb.PollsDisplayPK pollsDisplayPK)
      throws com.liferay.portlet.polls.NoSuchDisplayException, com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener) Class.forName(LISTENER).newInstance();
      } catch (Exception e) {
        Logger.error(PollsDisplayUtil.class, e.getMessage(), e);
      }
    }

    if (listener != null) {
      listener.onBeforeRemove(findByPrimaryKey(pollsDisplayPK));
    }

    com.liferay.portlet.polls.model.PollsDisplay pollsDisplay = persistence.remove(pollsDisplayPK);

    if (listener != null) {
      listener.onAfterRemove(pollsDisplay);
    }

    return pollsDisplay;
  }
Exemplo n.º 2
0
  protected static java.util.List findByL_U(
      java.lang.String layoutId, java.lang.String userId, int begin, int end)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findByL_U(layoutId, userId, begin, end);
  }
Exemplo n.º 3
0
  protected static com.liferay.portlet.polls.model.PollsDisplay findByQuestionId_Last(
      java.lang.String questionId, com.liferay.util.dao.hibernate.OrderByComparator obc)
      throws com.liferay.portlet.polls.NoSuchDisplayException, com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findByQuestionId_Last(questionId, obc);
  }
Exemplo n.º 4
0
  protected static com.liferay.portlet.polls.model.PollsDisplay findByPrimaryKey(
      com.liferay.portlet.polls.ejb.PollsDisplayPK pollsDisplayPK)
      throws com.liferay.portlet.polls.NoSuchDisplayException, com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findByPrimaryKey(pollsDisplayPK);
  }
Exemplo n.º 5
0
  protected static com.liferay.portlet.polls.model.PollsDisplay[] findByUserId_PrevAndNext(
      com.liferay.portlet.polls.ejb.PollsDisplayPK pollsDisplayPK,
      java.lang.String userId,
      com.liferay.util.dao.hibernate.OrderByComparator obc)
      throws com.liferay.portlet.polls.NoSuchDisplayException, com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findByUserId_PrevAndNext(pollsDisplayPK, userId, obc);
  }
Exemplo n.º 6
0
  protected static java.util.List findByQuestionId(
      java.lang.String questionId,
      int begin,
      int end,
      com.liferay.util.dao.hibernate.OrderByComparator obc)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findByQuestionId(questionId, begin, end, obc);
  }
Exemplo n.º 7
0
  protected static com.liferay.portlet.polls.model.PollsDisplay update(
      com.liferay.portlet.polls.model.PollsDisplay pollsDisplay)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);
    ModelListener listener = null;

    if (Validator.isNotNull(LISTENER)) {
      try {
        listener = (ModelListener) Class.forName(LISTENER).newInstance();
      } catch (Exception e) {
        Logger.error(PollsDisplayUtil.class, e.getMessage(), e);
      }
    }

    boolean isNew = pollsDisplay.isNew();

    if (listener != null) {
      if (isNew) {
        listener.onBeforeCreate(pollsDisplay);
      } else {
        listener.onBeforeUpdate(pollsDisplay);
      }
    }

    pollsDisplay = persistence.update(pollsDisplay);

    if (listener != null) {
      if (isNew) {
        listener.onAfterCreate(pollsDisplay);
      } else {
        listener.onAfterUpdate(pollsDisplay);
      }
    }

    return pollsDisplay;
  }
Exemplo n.º 8
0
  protected static com.liferay.portlet.polls.model.PollsDisplay create(
      com.liferay.portlet.polls.ejb.PollsDisplayPK pollsDisplayPK) {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.create(pollsDisplayPK);
  }
Exemplo n.º 9
0
  protected static int countByL_U(java.lang.String layoutId, java.lang.String userId)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.countByL_U(layoutId, userId);
  }
Exemplo n.º 10
0
  protected static int countByQuestionId(java.lang.String questionId)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.countByQuestionId(questionId);
  }
Exemplo n.º 11
0
 protected static void removeByUserId(java.lang.String userId)
     throws com.liferay.portal.SystemException {
   PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);
   persistence.removeByUserId(userId);
 }
Exemplo n.º 12
0
  protected static java.util.List findAll() throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findAll();
  }
Exemplo n.º 13
0
  protected static java.util.List findByUserId(java.lang.String userId)
      throws com.liferay.portal.SystemException {
    PollsDisplayPersistence persistence = (PollsDisplayPersistence) InstancePool.get(PERSISTENCE);

    return persistence.findByUserId(userId);
  }