I am saving my data into a selected database with my default method. However, there is 1 entity that i want to save on different table's column. How should i change on my method?
LoginBean.java
private String fullName_;
private String gender_;
private String phoneNumber_;
private String IC_;
private String email_;
private String Address_;
private String password_;
private String course;
List<String> courseOption;
public LoginBean(){
courseOption = new ArrayList<>();
courseOption.add("Information Technology");
courseOption.add("Business Management");
courseOption.add("Engineering");
courseOption.add("Design");
//getter and setter
public String saveUserStudent(LoginBean loginBean){
UserDao dao = new UserDao();
User user = new User();
user.setFullName(loginBean.getFullName_());
user.setGender(loginBean.getGender_());
user.setPhoneNumber(Integer.parseInt(loginBean.getPhoneNumber_()));
user.setIc(loginBean.getIC_());
user.setEmail(loginBean.getEmail_());
user.setAddress(loginBean.getAddress_());
user.setPassword(loginBean.getPassword_());
dao.saveUserStudent(user);
Map<String,Object> sessionMapObj = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
sessionMapObj.put("msg", "Data "+user.getIc() +"successfull!");
my dao.saveUserStudent(user) is the method name that has been saved on the directed database. Is there anything i should add or change on the source code?