use of com.liferay.blade.samples.servicebuilder.adq.exception.NoSuchBarException in project liferay-blade-samples by liferay.
the class BarPersistenceImpl method findByUuid_Last.
/**
* Returns the last bar 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 bar
* @throws NoSuchBarException if a matching bar could not be found
*/
@Override
public Bar findByUuid_Last(String uuid, OrderByComparator<Bar> orderByComparator) throws NoSuchBarException {
Bar bar = fetchByUuid_Last(uuid, orderByComparator);
if (bar != null) {
return bar;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uuid);
msg.append("}");
throw new NoSuchBarException(msg.toString());
}
use of com.liferay.blade.samples.servicebuilder.adq.exception.NoSuchBarException in project liferay-blade-samples by liferay.
the class BarPersistenceImpl method remove.
/**
* Removes the bar with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the bar
* @return the bar that was removed
* @throws NoSuchBarException if a bar with the primary key could not be found
*/
@Override
public Bar remove(Serializable primaryKey) throws NoSuchBarException {
Session session = null;
try {
session = openSession();
Bar bar = (Bar) session.get(BarImpl.class, primaryKey);
if (bar == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchBarException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
return remove(bar);
} catch (NoSuchBarException nsee) {
throw nsee;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.blade.samples.servicebuilder.adq.exception.NoSuchBarException in project liferay-blade-samples by liferay.
the class BarPersistenceImpl method findByUuid_PrevAndNext.
/**
* Returns the bars before and after the current bar in the ordered set where uuid = ?.
*
* @param barId the primary key of the current bar
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next bar
* @throws NoSuchBarException if a bar with the primary key could not be found
*/
@Override
public Bar[] findByUuid_PrevAndNext(long barId, String uuid, OrderByComparator<Bar> orderByComparator) throws NoSuchBarException {
uuid = Objects.toString(uuid, "");
Bar bar = findByPrimaryKey(barId);
Session session = null;
try {
session = openSession();
Bar[] array = new BarImpl[3];
array[0] = getByUuid_PrevAndNext(session, bar, uuid, orderByComparator, true);
array[1] = bar;
array[2] = getByUuid_PrevAndNext(session, bar, uuid, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.blade.samples.servicebuilder.adq.exception.NoSuchBarException in project liferay-blade-samples by liferay.
the class BarPersistenceImpl method findByUuid_C_PrevAndNext.
/**
* Returns the bars before and after the current bar in the ordered set where uuid = ? and companyId = ?.
*
* @param barId the primary key of the current bar
* @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 bar
* @throws NoSuchBarException if a bar with the primary key could not be found
*/
@Override
public Bar[] findByUuid_C_PrevAndNext(long barId, String uuid, long companyId, OrderByComparator<Bar> orderByComparator) throws NoSuchBarException {
uuid = Objects.toString(uuid, "");
Bar bar = findByPrimaryKey(barId);
Session session = null;
try {
session = openSession();
Bar[] array = new BarImpl[3];
array[0] = getByUuid_C_PrevAndNext(session, bar, uuid, companyId, orderByComparator, true);
array[1] = bar;
array[2] = getByUuid_C_PrevAndNext(session, bar, uuid, companyId, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
use of com.liferay.blade.samples.servicebuilder.adq.exception.NoSuchBarException in project liferay-blade-samples by liferay.
the class BarPersistenceImpl method findByField2_PrevAndNext.
/**
* Returns the bars before and after the current bar in the ordered set where field2 = ?.
*
* @param barId the primary key of the current bar
* @param field2 the field2
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next bar
* @throws NoSuchBarException if a bar with the primary key could not be found
*/
@Override
public Bar[] findByField2_PrevAndNext(long barId, boolean field2, OrderByComparator<Bar> orderByComparator) throws NoSuchBarException {
Bar bar = findByPrimaryKey(barId);
Session session = null;
try {
session = openSession();
Bar[] array = new BarImpl[3];
array[0] = getByField2_PrevAndNext(session, bar, field2, orderByComparator, true);
array[1] = bar;
array[2] = getByField2_PrevAndNext(session, bar, field2, orderByComparator, false);
return array;
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
}
Aggregations