fixed borken update (entity, updatedBy) method
This commit is contained in:
@ -138,15 +138,14 @@ public abstract class CommonAbstractController {
|
||||
@Lock(LockType.WRITE)
|
||||
public <T extends Serializable> T update(T entity, String updatedBy) throws ControllerException {
|
||||
T currentEntity = executeUpdate(entity, updatedBy);
|
||||
T newEntity = EntityUtil.cloneToNewEntity(currentEntity);
|
||||
if (EndDateable.class.isAssignableFrom(entity.getClass())) {
|
||||
T newEntity = EntityUtil.cloneToNewEntity(currentEntity);
|
||||
em.merge(currentEntity);
|
||||
|
||||
return create(newEntity, updatedBy);
|
||||
} else {
|
||||
// if it is not enddatable, just update it (already done above)
|
||||
// and save it
|
||||
return em.merge(entity);
|
||||
return em.merge(currentEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user