Search in sources :

Example 11 with NoSuchFooException

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

the class FooPersistenceImpl method findByUuid_First.

/**
 * Returns the first 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 first matching foo
 * @throws NoSuchFooException if a matching foo could not be found
 */
@Override
public Foo findByUuid_First(String uuid, OrderByComparator<Foo> orderByComparator) throws NoSuchFooException {
    Foo foo = fetchByUuid_First(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(StringPool.CLOSE_CURLY_BRACE);
    throw new NoSuchFooException(msg.toString());
}
Also used : NoSuchFooException(com.liferay.blade.samples.servicebuilder.exception.NoSuchFooException) Foo(com.liferay.blade.samples.servicebuilder.model.Foo) StringBundler(com.liferay.portal.kernel.util.StringBundler)

Aggregations

NoSuchFooException (com.liferay.blade.samples.servicebuilder.exception.NoSuchFooException)11 Foo (com.liferay.blade.samples.servicebuilder.model.Foo)11 StringBundler (com.liferay.portal.kernel.util.StringBundler)7 FooImpl (com.liferay.blade.samples.servicebuilder.model.impl.FooImpl)4 Session (com.liferay.portal.kernel.dao.orm.Session)4