Search in sources :

Example 1 with BazImpl

use of com.liferay.blade.workflow.basic.model.impl.BazImpl in project liferay-blade-samples by liferay.

the class BazPersistenceImpl method findByUuid_PrevAndNext.

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

Example 2 with BazImpl

use of com.liferay.blade.workflow.basic.model.impl.BazImpl in project liferay-blade-samples by liferay.

the class BazPersistenceImpl method create.

/**
 * Creates a new baz with the primary key. Does not add the baz to the database.
 *
 * @param bazId the primary key for the new baz
 * @return the new baz
 */
@Override
public Baz create(long bazId) {
    Baz baz = new BazImpl();
    baz.setNew(true);
    baz.setPrimaryKey(bazId);
    String uuid = PortalUUIDUtil.generate();
    baz.setUuid(uuid);
    baz.setCompanyId(companyProvider.getCompanyId());
    return baz;
}
Also used : BazImpl(com.liferay.blade.workflow.basic.model.impl.BazImpl) Baz(com.liferay.blade.workflow.basic.model.Baz)

Example 3 with BazImpl

use of com.liferay.blade.workflow.basic.model.impl.BazImpl in project liferay-blade-samples by liferay.

the class BazPersistenceImpl method findByUuid_C_PrevAndNext.

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

Aggregations

Baz (com.liferay.blade.workflow.basic.model.Baz)3 BazImpl (com.liferay.blade.workflow.basic.model.impl.BazImpl)3 NoSuchBazException (com.liferay.blade.workflow.basic.exception.NoSuchBazException)2 Session (com.liferay.portal.kernel.dao.orm.Session)2