Search in sources :

Example 6 with NoSuchCommentException

use of com.liferay.knowledgebase.NoSuchCommentException in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method findByUUID_G.

/**
 * Returns the k b comment where uuid = ? and groupId = ? or throws a {@link com.liferay.knowledgebase.NoSuchCommentException} if it could not be found.
 *
 * @param uuid the uuid
 * @param groupId the group ID
 * @return the matching k b comment
 * @throws com.liferay.knowledgebase.NoSuchCommentException if a matching k b comment could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBComment findByUUID_G(String uuid, long groupId) throws NoSuchCommentException, SystemException {
    KBComment kbComment = fetchByUUID_G(uuid, groupId);
    if (kbComment == null) {
        StringBundler msg = new StringBundler(6);
        msg.append(_NO_SUCH_ENTITY_WITH_KEY);
        msg.append("uuid=");
        msg.append(uuid);
        msg.append(", groupId=");
        msg.append(groupId);
        msg.append(StringPool.CLOSE_CURLY_BRACE);
        if (_log.isWarnEnabled()) {
            _log.warn(msg.toString());
        }
        throw new NoSuchCommentException(msg.toString());
    }
    return kbComment;
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 7 with NoSuchCommentException

use of com.liferay.knowledgebase.NoSuchCommentException 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 8 with NoSuchCommentException

use of com.liferay.knowledgebase.NoSuchCommentException in project liferay-ide by liferay.

the class KBCommentPersistenceImpl method findByC_C_S_First.

/**
 * Returns the first k b comment in the ordered set where classNameId = &#63; and classPK = &#63; and status = &#63;.
 *
 * @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 first matching k b comment
 * @throws com.liferay.knowledgebase.NoSuchCommentException if a matching k b comment could not be found
 * @throws SystemException if a system exception occurred
 */
@Override
public KBComment findByC_C_S_First(long classNameId, long classPK, int status, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = fetchByC_C_S_First(classNameId, classPK, status, orderByComparator);
    if (kbComment != null) {
        return kbComment;
    }
    StringBundler msg = new StringBundler(8);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("classNameId=");
    msg.append(classNameId);
    msg.append(", classPK=");
    msg.append(classPK);
    msg.append(", status=");
    msg.append(status);
    msg.append(StringPool.CLOSE_CURLY_BRACE);
    throw new NoSuchCommentException(msg.toString());
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Example 9 with NoSuchCommentException

use of com.liferay.knowledgebase.NoSuchCommentException 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 10 with NoSuchCommentException

use of com.liferay.knowledgebase.NoSuchCommentException 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)

Aggregations

NoSuchCommentException (com.liferay.knowledgebase.NoSuchCommentException)26 KBComment (com.liferay.knowledgebase.model.KBComment)26 StringBundler (com.liferay.portal.kernel.util.StringBundler)17 KBCommentImpl (com.liferay.knowledgebase.model.impl.KBCommentImpl)9 Session (com.liferay.portal.kernel.dao.orm.Session)9 SystemException (com.liferay.portal.kernel.exception.SystemException)9