N+1 relationship in POJO defination
<p>I have question regarding 1+N relation ship. I have designed POJO as below which has Workplace and Employee relationship.</p>

<p>1+N --> One company many employees</p>

<pre><code>public class WorkplaceDetail implements Serializable {

private static final long serialVersionUID = -6760386803958725272L;
private int code;
private String plant;
private String compRegNum;
private String numOfEmps;
private List &lt;Employee&gt; employee = new ArrayList&lt;Employee&gt;();
      private Address address;
}

public class Employee{

private String empName;
private int empNumber;
      private Address address;
}
</code></pre>

<p>public class Address {</p>

<pre><code>private String primaryPhone;
private String secPhone;
private String mobileNum;
private String fax;
private String zip;
private String add1;
private String add2;
</code></pre>

<p>}
<strong>Or</strong></p>

<p>N+1 relationship where Employees belong to one workplace.</p>

<pre><code>public class WorkplaceDetail implements Serializable {

private static final long serialVersionUID = -6760386803958725272L;
private int code;
private String plant;
private String compRegNum;
private String numOfEmps;   
}

public class Employee{


private String empName;
private int empNumber;
    private WorkplaceDetail WorkplaceDetail;
}
</code></pre>

<p>Please let me know which one is correct approach.</p>
