@RequestMapping("perm-type-save")
public String save(@ModelAttribute PermType permType,
RedirectAttributes redirectAttributes) {
// copy
PermType dest = null;
Long id = permType.getId();
if (id != null) {
dest = permTypeManager.get(id);
beanMapper.copy(permType, dest);
} else {
dest = permType;
}
if (id == null) {
dest.setScopeId(ScopeHolder.getScopeId());
}
// save
permTypeManager.save(dest);