if (super.postUpdate(beforeEntity, afterEntity))
{
final Course beforeCourse = (Course) beforeEntity;
final Course afterCourse = (Course) afterEntity;
final Discipline beforeDiscipline = beforeCourse
.getDiscipline();
final Discipline afterDiscipline = afterCourse.getDiscipline();
if (beforeEntity != afterEntity)
{
if (beforeDiscipline.getCourses().contain(beforeCourse))
post = beforeDiscipline.getCourses().remove(
beforeCourse);
if (post && !afterDiscipline.getCourses().contain(afterCourse))
post = afterDiscipline.getCourses().add(afterCourse);
}
}
else
{
post = false;