I am currently developing a project for my final year.
I have two web pages first contains user's Personal details and second contains user's professional details.
Kindly guide me If I should have one pojo class for both the pages or separate for each of them.
Also let me know how should be my database design For Eg : Two separate tables for both the pages or just once table having column to map the data from both the pages.
Also advise if I should save the data entered in first page (after validating) before redirecting the user to his professional page or should I save the data of both the pages together in Second page.
1.According to me you should have separate pojo classes for user and professional. 2.Also, there should be two tables of user and professional. 3.You may save the user's save the details first and then redirect the user to other professional page and then fill the mandatory details of professional.
Please go through the details below.
@Entity
@Table(name = "user")
public class User {
private Long id;/*should auto generate with auto increment*/
private String firstName;
private String lastName;
private String userName;
private String mobileNumber;/*(change according to your requirement)*/
private String email1;
private String email2;
/*getters and setters*/
/*specify not null fields according to your requirement*/
}
@Entity
@Table(name = "professional")
public class Professional {
private Long id;/*should auto generate with auto increment*/
private User userId;/*one to one mapping*/
private Boolean whetherProfessional;
private String areaOfExpertise;
/*other fields according to your requirement*/
/*getters and setters*/
/*specify not null fields according to your requirement*/
}