Search in sources :

Example 11 with NoSuchFooException

use of com.liferay.blade.basic.exception.NoSuchFooException in project liferay-blade-samples by liferay.

the class FooPersistenceImpl method findByUuid_Last.

/**
 * Returns the last foo in the ordered set where uuid = ?.
 *
 * @param uuid the uuid
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the last matching foo
 * @throws NoSuchFooException if a matching foo could not be found
 */
@Override
public Foo findByUuid_Last(String uuid, OrderByComparator<Foo> orderByComparator) throws NoSuchFooException {
    Foo foo = fetchByUuid_Last(uuid, orderByComparator);
    if (foo != null) {
        return foo;
    }
    StringBundler msg = new StringBundler(4);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("uuid=");
    msg.append(uuid);
    msg.append("}");
    throw new NoSuchFooException(msg.toString());
}
Also used : NoSuchFooException(com.liferay.blade.basic.exception.NoSuchFooException) Foo(com.liferay.blade.basic.model.Foo) StringBundler(com.liferay.petra.string.StringBundler)

Aggregations

NoSuchFooException (com.liferay.blade.basic.exception.NoSuchFooException)11 Foo (com.liferay.blade.basic.model.Foo)11 StringBundler (com.liferay.petra.string.StringBundler)7 FooImpl (com.liferay.blade.basic.model.impl.FooImpl)4 Session (com.liferay.portal.kernel.dao.orm.Session)4