targetBranch.setParent(parent);
final Branch storedBranch = branchDao.readByName(targetBranch.getName(), parentId);
if (storedBranch == null) {
targetBranch.setBranchId(0);
branchDao.save(targetBranch);
} else {
targetBranch = storedBranch;
}
return targetBranch;
}