Search in sources :

Example 1 with NoSuchCommentException

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

the class KBCommentPersistenceImpl method findByG_S_Last.

/**
 * Returns the last k b comment in the ordered set where groupId = ? and status = ?.
 *
 * @param groupId the group ID
 * @param status the status
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the last 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 findByG_S_Last(long groupId, int status, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = fetchByG_S_Last(groupId, status, orderByComparator);
    if (kbComment != null) {
        return kbComment;
    }
    StringBundler msg = new StringBundler(6);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("groupId=");
    msg.append(groupId);
    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 2 with NoSuchCommentException

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

the class KBCommentPersistenceImpl method findByU_C_C_First.

/**
 * Returns the first k b comment in the ordered set where userId = &#63; and classNameId = &#63; and classPK = &#63;.
 *
 * @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 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 findByU_C_C_First(long userId, long classNameId, long classPK, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = fetchByU_C_C_First(userId, classNameId, classPK, orderByComparator);
    if (kbComment != null) {
        return kbComment;
    }
    StringBundler msg = new StringBundler(8);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("userId=");
    msg.append(userId);
    msg.append(", classNameId=");
    msg.append(classNameId);
    msg.append(", classPK=");
    msg.append(classPK);
    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 3 with NoSuchCommentException

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

the class KBCommentPersistenceImpl method remove.

/**
 * Removes the k b comment with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the k b comment
 * @return the k b comment that was removed
 * @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 remove(Serializable primaryKey) throws NoSuchCommentException, SystemException {
    Session session = null;
    try {
        session = openSession();
        KBComment kbComment = (KBComment) session.get(KBCommentImpl.class, primaryKey);
        if (kbComment == null) {
            if (_log.isWarnEnabled()) {
                _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
            }
            throw new NoSuchCommentException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
        return remove(kbComment);
    } catch (NoSuchCommentException nsee) {
        throw nsee;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : KBComment(com.liferay.knowledgebase.model.KBComment) NoSuchCommentException(com.liferay.knowledgebase.NoSuchCommentException) 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 NoSuchCommentException

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

the class KBCommentPersistenceImpl method findByU_C_C_Last.

/**
 * Returns the last k b comment in the ordered set where userId = &#63; and classNameId = &#63; and classPK = &#63;.
 *
 * @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 last 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 findByU_C_C_Last(long userId, long classNameId, long classPK, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = fetchByU_C_C_Last(userId, classNameId, classPK, orderByComparator);
    if (kbComment != null) {
        return kbComment;
    }
    StringBundler msg = new StringBundler(8);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("userId=");
    msg.append(userId);
    msg.append(", classNameId=");
    msg.append(classNameId);
    msg.append(", classPK=");
    msg.append(classPK);
    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 5 with NoSuchCommentException

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

the class KBCommentPersistenceImpl method findByGroupId_First.

/**
 * Returns the first k b comment in the ordered set where groupId = &#63;.
 *
 * @param groupId the group ID
 * @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 findByGroupId_First(long groupId, OrderByComparator orderByComparator) throws NoSuchCommentException, SystemException {
    KBComment kbComment = fetchByGroupId_First(groupId, orderByComparator);
    if (kbComment != null) {
        return kbComment;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("groupId=");
    msg.append(groupId);
    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)

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