title: i'm getting null value in a child table as a foreign key of parent table using spring data rest or spring data jpa accosiation
body: <p><a href="https://i.stack.imgur.com/xhHLm.png" rel="nofollow noreferrer">enter image description here</a>  In this image first address for empId 1 and last two records are empid 2 (empid 2 haveing to address)
  file:///home/user/Pictures/fk.png</p>
  
  <pre><code>@Entity
  
  @Table(name = "Employee")
  
  public class Employee {
  
  @Id
  @GeneratedValue
  private Integer id;
  private String name;
  private Integer sal;
  
  @OneToMany(cascade = CascadeType.ALL,mappedBy="employee")
  private List&lt;Address&gt; addresses;
  </code></pre>
  
  <p>//getter setter</p>
  
  <p>Child entity</p>
  
  <pre><code>@Entity(name="Address")
  
  public class Address {
  
  @Id
  @GeneratedValue
  private Integer aid;
  private String city;
  private String state;
  
  @ManyToOne
  @JoinColumn(name="id")
  private Employee employee;
  
  //getter setter
  </code></pre>
  
  <p>Repository </p>
  
  <pre><code>@Repository
  
  @RepositoryRestResource(path="employee")
  
  public interface EmployeeRepo extends JpaRepository&lt;Employee,Integer&gt; {
  
  
  }
  </code></pre>
  
  <p>Input from RestClient </p>
  
  <pre><code>{
    "name":"rdhe",
  
    "sal":"20000",
  
    "addresses":[{ 
  
    "city":"hyd",
  
    "state":"ts"
  
    }]
  }
  </code></pre>
  
  <p>if i use spring data jpa then code will be 
  // jpa Repository</p>
  
  <pre><code>public interface EmployeeRepo extends JpaRepository&lt;Employee,Integer&gt; {
  
  
  }
  </code></pre>
  
  <p>// EmployeeServer class</p>
  
  <pre><code>@Service
  public class EmployeeService {
  
  @Autowired
  EmployeeRepo employeeRepo;
  public void saveEmployee(Employee employee){
      employeeRepo.save(employee);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>// controller</p>
  
  <pre><code>@RestController
  public class EmployeeController {
  
  @Autowired
  EmployeeService employeeService;
  
  @PostMapping(path="/save")
  public void saveEmp(@RequestBody Employee employee){
      employeeService.saveEmployee(employee);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>if i'll use spring-data-rest at that time no need to create employeeService and controller class </p>