Search in sources :

Example 6 with NoSuchQuxException

use of com.liferay.blade.workflow.asset.exception.NoSuchQuxException in project liferay-blade-samples by liferay.

the class QuxPersistenceImpl method findByUuid_PrevAndNext.

/**
 * Returns the quxs before and after the current qux in the ordered set where uuid = ?.
 *
 * @param quxId the primary key of the current qux
 * @param uuid the uuid
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the previous, current, and next qux
 * @throws NoSuchQuxException if a qux with the primary key could not be found
 */
@Override
public Qux[] findByUuid_PrevAndNext(long quxId, String uuid, OrderByComparator<Qux> orderByComparator) throws NoSuchQuxException {
    uuid = Objects.toString(uuid, "");
    Qux qux = findByPrimaryKey(quxId);
    Session session = null;
    try {
        session = openSession();
        Qux[] array = new QuxImpl[3];
        array[0] = getByUuid_PrevAndNext(session, qux, uuid, orderByComparator, true);
        array[1] = qux;
        array[2] = getByUuid_PrevAndNext(session, qux, uuid, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux) QuxImpl(com.liferay.blade.workflow.asset.model.impl.QuxImpl) NoSuchQuxException(com.liferay.blade.workflow.asset.exception.NoSuchQuxException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 7 with NoSuchQuxException

use of com.liferay.blade.workflow.asset.exception.NoSuchQuxException in project liferay-blade-samples by liferay.

the class QuxPersistenceImpl method findByUuid_C_PrevAndNext.

/**
 * Returns the quxs before and after the current qux in the ordered set where uuid = &#63; and companyId = &#63;.
 *
 * @param quxId the primary key of the current qux
 * @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 qux
 * @throws NoSuchQuxException if a qux with the primary key could not be found
 */
@Override
public Qux[] findByUuid_C_PrevAndNext(long quxId, String uuid, long companyId, OrderByComparator<Qux> orderByComparator) throws NoSuchQuxException {
    uuid = Objects.toString(uuid, "");
    Qux qux = findByPrimaryKey(quxId);
    Session session = null;
    try {
        session = openSession();
        Qux[] array = new QuxImpl[3];
        array[0] = getByUuid_C_PrevAndNext(session, qux, uuid, companyId, orderByComparator, true);
        array[1] = qux;
        array[2] = getByUuid_C_PrevAndNext(session, qux, uuid, companyId, orderByComparator, false);
        return array;
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux) QuxImpl(com.liferay.blade.workflow.asset.model.impl.QuxImpl) NoSuchQuxException(com.liferay.blade.workflow.asset.exception.NoSuchQuxException) Session(com.liferay.portal.kernel.dao.orm.Session)

Example 8 with NoSuchQuxException

use of com.liferay.blade.workflow.asset.exception.NoSuchQuxException in project liferay-blade-samples by liferay.

the class QuxPersistenceImpl method findByUuid_C_First.

/**
 * Returns the first qux in the ordered set where uuid = &#63; and companyId = &#63;.
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the first matching qux
 * @throws NoSuchQuxException if a matching qux could not be found
 */
@Override
public Qux findByUuid_C_First(String uuid, long companyId, OrderByComparator<Qux> orderByComparator) throws NoSuchQuxException {
    Qux qux = fetchByUuid_C_First(uuid, companyId, orderByComparator);
    if (qux != null) {
        return qux;
    }
    StringBundler msg = new StringBundler(6);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("uuid=");
    msg.append(uuid);
    msg.append(", companyId=");
    msg.append(companyId);
    msg.append("}");
    throw new NoSuchQuxException(msg.toString());
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux) NoSuchQuxException(com.liferay.blade.workflow.asset.exception.NoSuchQuxException) StringBundler(com.liferay.petra.string.StringBundler)

Aggregations

NoSuchQuxException (com.liferay.blade.workflow.asset.exception.NoSuchQuxException)8 Qux (com.liferay.blade.workflow.asset.model.Qux)8 StringBundler (com.liferay.petra.string.StringBundler)5 QuxImpl (com.liferay.blade.workflow.asset.model.impl.QuxImpl)3 Session (com.liferay.portal.kernel.dao.orm.Session)3