Currently I have a pojo
class Myclass{
private int taskid;
private String tasktype;
private int Monitory_by;
private int Assigned_by;
private int Report_to;
private int Assigned_to;
}
where Monitory_by ,Assigned_by, Report_to,Assigned_to are primary key values of users so I have pojo for users which gives all the data of users.
The point is to relate this to pojo where Monitory_by,Assigned_by fields are optional (i.e., the values may be given or not). please help me
Based on the tags you have used I am assuming that you are using Hibernate with JPA. I suggest going over the extensive documentation Hibernate provides on entity mapping. This reference includes help on primary key mapping (Ids) and foreign key (one-to-many) mappings.