Fix relationship in BranchCodeEntity and fix logic in UserServiceValidator and BranchCodeServiceImpl.