private List<UserRole> createUserRoleData(String userCode, String[] roleCodes) {
roleSetDao.deleteByUserCode(userCode);
List<UserRole> rlSet = new ArrayList<UserRole>();
for (String roleCode : roleCodes) {
UserRole userRole = roleSetDao.findByUserCodeAndRoleCode(userCode,
roleCode);
if (userRole == null) {
userRole = new UserRole();
}
userRole.setUserCode(userCode);
userRole.setRoleCode(roleCode);
userRole.setUpdater(CapSecurityContext.getUserId());
userRole.setUpdateTime(CapDate.getCurrentTimestamp());
rlSet.add(userRole);
}
return rlSet;
}// ;