Search in sources :

Example 6 with KBCommentImpl

use of com.liferay.knowledgebase.model.impl.KBCommentImpl in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method findByGroupId_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where groupId = ?.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param groupId the group ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b comment
 * @throws com.liferay.knowledgebase.NoSuchCommentException if a k b comment with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBComment[] findByGroupId_PrevAndNext(long kbCommentId, long groupId, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByGroupId_PrevAndNext(session, kbComment, groupId, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByGroupId_PrevAndNext(session, kbComment, groupId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) KBCommentImpl(com.liferay.knowledgebase.model.impl.KBCommentImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 7 with KBCommentImpl

use of com.liferay.knowledgebase.model.impl.KBCommentImpl in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method findByU_C_C_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where userId = &#63; and classNameId = &#63; and classPK = &#63;.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param userId the user ID
 * @param classNameId the class name ID
 * @param classPK the class p k
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b comment
 * @throws com.liferay.knowledgebase.NoSuchCommentException if a k b comment with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBComment[] findByU_C_C_PrevAndNext(long kbCommentId, long userId, long classNameId, long classPK, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByU_C_C_PrevAndNext(session, kbComment, userId, classNameId, classPK, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByU_C_C_PrevAndNext(session, kbComment, userId, classNameId, classPK, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) KBCommentImpl(com.liferay.knowledgebase.model.impl.KBCommentImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 8 with KBCommentImpl

use of com.liferay.knowledgebase.model.impl.KBCommentImpl in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method toUnwrappedModel.

protected KBComment toUnwrappedModel(KBComment kbComment) {
    if (kbComment instanceof KBCommentImpl) {
        return kbComment;
    }
    KBCommentImpl kbCommentImpl = new KBCommentImpl();
    kbCommentImpl.setNew(kbComment.isNew());
    kbCommentImpl.setPrimaryKey(kbComment.getPrimaryKey());
    kbCommentImpl.setUuid(kbComment.getUuid());
    kbCommentImpl.setKbCommentId(kbComment.getKbCommentId());
    kbCommentImpl.setGroupId(kbComment.getGroupId());
    kbCommentImpl.setCompanyId(kbComment.getCompanyId());
    kbCommentImpl.setUserId(kbComment.getUserId());
    kbCommentImpl.setUserName(kbComment.getUserName());
    kbCommentImpl.setCreateDate(kbComment.getCreateDate());
    kbCommentImpl.setModifiedDate(kbComment.getModifiedDate());
    kbCommentImpl.setClassNameId(kbComment.getClassNameId());
    kbCommentImpl.setClassPK(kbComment.getClassPK());
    kbCommentImpl.setContent(kbComment.getContent());
    kbCommentImpl.setUserRating(kbComment.getUserRating());
    kbCommentImpl.setStatus(kbComment.getStatus());
    return kbCommentImpl;
}
Also used : KBCommentImpl(com.liferay.knowledgebase.model.impl.KBCommentImpl)

Example 9 with KBCommentImpl

use of com.liferay.knowledgebase.model.impl.KBCommentImpl in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method findByG_S_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where groupId = &#63; and status = &#63;.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param groupId the group ID
 * @param status the status
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b comment
 * @throws com.liferay.knowledgebase.NoSuchCommentException if a k b comment with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBComment[] findByG_S_PrevAndNext(long kbCommentId, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByG_S_PrevAndNext(session, kbComment, groupId, status, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByG_S_PrevAndNext(session, kbComment, groupId, status, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) KBCommentImpl(com.liferay.knowledgebase.model.impl.KBCommentImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 10 with KBCommentImpl

use of com.liferay.knowledgebase.model.impl.KBCommentImpl in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method findByUuid_C_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where uuid = &#63; and companyId = &#63;.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param uuid the uuid
 * @param companyId the company ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next k b comment
 * @throws com.liferay.knowledgebase.NoSuchCommentException if a k b comment with the primary key could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBComment[] findByUuid_C_PrevAndNext(long kbCommentId, String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByUuid_C_PrevAndNext(session, kbComment, uuid, companyId, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByUuid_C_PrevAndNext(session, kbComment, uuid, companyId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) KBCommentImpl(com.liferay.knowledgebase.model.impl.KBCommentImpl) SystemException(com.liferay.portal.kernel.exception.SystemException) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) Session(com.liferay.portal.kernel.dao.orm.Session)

Aggregations

KBCommentImpl (com.liferay.knowledgebase.model.impl.KBCommentImpl)10 KBComment (com.liferay.knowledgebase.model.KBComment)9 NoSuchCommentException (com.liferay.knowledgebase.NoSuchCommentException)8 Session (com.liferay.portal.kernel.dao.orm.Session)8 SystemException (com.liferay.portal.kernel.exception.SystemException)8