added missing ControllerExceptions
This commit is contained in:
@ -58,7 +58,7 @@ public abstract class AbstractController<T> {
|
||||
this.entityClass = clazz;
|
||||
}
|
||||
|
||||
public void applyUpdateableChanges(Updateable updateable, boolean onCreate) {
|
||||
public void applyUpdateableChanges(Updateable updateable, boolean onCreate) throws ControllerException {
|
||||
if (onCreate) {
|
||||
updateable.setCreatedBy(account.getUsername());
|
||||
updateable.setCreatedOn(new Date());
|
||||
@ -74,7 +74,7 @@ public abstract class AbstractController<T> {
|
||||
@TransactionAttribute(TransactionAttributeType.REQUIRED)
|
||||
@Transactional
|
||||
@Lock(LockType.WRITE)
|
||||
public void create(T entity) {
|
||||
public void create(T entity) throws ControllerException {
|
||||
if (Updateable.class.isAssignableFrom(entity.getClass())) {
|
||||
Updateable updateable = (Updateable) entity;
|
||||
applyUpdateableChanges(updateable, true);
|
||||
@ -85,7 +85,7 @@ public abstract class AbstractController<T> {
|
||||
@TransactionAttribute(TransactionAttributeType.REQUIRED)
|
||||
@Transactional
|
||||
@Lock(LockType.WRITE)
|
||||
public T update(T entity) {
|
||||
public T update(T entity) throws ControllerException {
|
||||
if (Updateable.class.isAssignableFrom(entity.getClass())) {
|
||||
Updateable updateable = (Updateable) entity;
|
||||
applyUpdateableChanges(updateable, false);
|
||||
@ -125,7 +125,7 @@ public abstract class AbstractController<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* returnns null, if the list is empty or null itself. Returns the one
|
||||
* returns null, if the list is empty or null itself. Returns the one
|
||||
* element if there is exactly one element in the list. Otherwise an
|
||||
* exception is thrown
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user