this.fromApiJsonDeserializer.validateForUnassignStaff(command.json());
final Group groupForUpdate = this.groupRepository.findOneWithNotFoundDetection(grouptId);
final Staff presentStaff = groupForUpdate.getStaff();
Long presentStaffId = null;
if (presentStaff == null) { throw new GroupHasNoStaffException(grouptId); }
presentStaffId = presentStaff.getId();
final String staffIdParamName = "staffId";
if (!command.isChangeInLongParameterNamed(staffIdParamName, presentStaffId)) {
groupForUpdate.unassignStaff();
}
this.groupRepository.saveAndFlush(groupForUpdate);