added Controller Exception on delete method
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user