Hi I have a table Employee with fields
emp_id
emp_name
emp_role
created_by
updated_by
For this I have defined classes
Code:
Class UserInfo{
private int created_by;
private int updated_by;
<<Getters & Setters>>
}
Class Employee{
private int empID;
private String empName;
private String empRole;
<<Getters & Setters>>
}
The reason I have a class called UserInfo is because I can use this class for all other tables. The usage of UserInfo inside employee is given below
Code:
Class Employee{
private int empID;
private String empName;
private String empRole;
private UserInfo userInfo;
<<Getters & Setters>>
}
Questions:
1. I am not sure whether I can do like this or not. Would you please tell whether I can do this way?
2. I had even problems to put the Mapping class too for the same. Would you please how I can do this?
Thanks in advance,
Sham.