added Controller Exception on delete method

This commit is contained in:
2019-01-22 09:55:05 +01:00
parent ac2cf1b784
commit 49e0c9651e
2 changed files with 2 additions and 1 deletions

View File

@ -91,7 +91,7 @@ public abstract class AbstractController<T> {
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@Transactional
@Lock(LockType.WRITE)
public void delete(T entity) {
public void delete(T entity) throws ControllerException {
em.remove(attach(entity));
}

View File

@ -26,6 +26,7 @@ public class ControllerException extends Exception {
public static final int CAUSE_NOT_FOUND = 2;
public static final int CAUSE_CANNOT_PERSIST = 3;
public static final int CAUSE_TOO_MANY_ROWS = 4;
public static final int CAUSE_CANNOT_DELETE = 5;
private final int causeCode;