Search in sources :

Example 1 with KBCommentImpl

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

the class KBCommentPersistenceImpl method findByUuid_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where uuid = ?.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param uuid the uuid
 * @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_PrevAndNext(long kbCommentId, String uuid, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByUuid_PrevAndNext(session, kbComment, uuid, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByUuid_PrevAndNext(session, kbComment, uuid, 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 2 with KBCommentImpl

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

the class KBCommentPersistenceImpl method findByC_C_S_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where classNameId = &#63; and classPK = &#63; and status = &#63;.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param classNameId the class name ID
 * @param classPK the class p k
 * @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[] findByC_C_S_PrevAndNext(long kbCommentId, long classNameId, long classPK, int status, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByC_C_S_PrevAndNext(session, kbComment, classNameId, classPK, status, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByC_C_S_PrevAndNext(session, kbComment, classNameId, classPK, 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 3 with KBCommentImpl

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

the class KBCommentPersistenceImpl method findByC_C_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where classNameId = &#63; and classPK = &#63;.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @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[] findByC_C_PrevAndNext(long kbCommentId, 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] = getByC_C_PrevAndNext(session, kbComment, classNameId, classPK, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByC_C_PrevAndNext(session, kbComment, 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 4 with KBCommentImpl

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

the class KBCommentPersistenceImpl method findByG_C_PrevAndNext.

/**
 * Returns the k b comments before and after the current k b comment in the ordered set where groupId = &#63; and classNameId = &#63;.
 *
 * @param kbCommentId the primary key of the current k b comment
 * @param groupId the group ID
 * @param classNameId the class name 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[] findByG_C_PrevAndNext(long kbCommentId, long groupId, long classNameId, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = findByPrimaryKey(kbCommentId);
    Session session = null;
    try {
        session = openSession();
        KBComment[] array = new KBCommentImpl[3];
        array[0] = getByG_C_PrevAndNext(session, kbComment, groupId, classNameId, orderByComparator, true);
        array[1] = kbComment;
        array[2] = getByG_C_PrevAndNext(session, kbComment, groupId, classNameId, 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 5 with KBCommentImpl

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

the class KBCommentPersistenceImpl method create.

/**
 * Creates a new k b comment with the primary key. Does not add the k b comment to the database.
 *
 * @param kbCommentId the primary key for the new k b comment
 * @return the new k b comment
 */
@Override
public KBComment create(long kbCommentId) {
    KBComment kbComment = new KBCommentImpl();
    kbComment.setNew(true);
    kbComment.setPrimaryKey(kbCommentId);
    String uuid = PortalUUIDUtil.generate();
    kbComment.setUuid(uuid);
    return kbComment;
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) KBCommentImpl(com.liferay.knowledgebase.model.impl.KBCommentImpl)

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