title: JPA ManyToOne/OneToMany not inserting the value on child
body: <p>I am developing a Rest API which will receive a JSON. I need to save the JSON correctly in a Postgres DB.</p>
  
  <p>Right now I have:</p>
  
  <pre><code>@Entity
  public class Customer {
      @Id
      @GeneratedValue(strategy = AUTO)
      private Long id;
      private String name;
      @OneToMany(mappedBy = "customer", cascade = ALL)
      private List&lt;Address&gt; address;
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>@Entity
  public class Address {
      @Id
      @GeneratedValue(strategy = AUTO)
      private Long id;
      private String city;
      private String number;
      private String country;
      @ManyToOne
      @JoinColumn(name = "customer_id", nullable = false)
      private Customer customer;
  }
  </code></pre>
  
  <p>My controller has only this:</p>
  
  <pre><code>@RequestMapping(method = POST)
  public ResponseEntity create(@RequestBody Customer customer) {
      Customer customerSaved = repository.save(customer);
      return new ResponseEntity(customerSaved, CREATED);
  }
  </code></pre>
  
  <p>When I send a JSON like:</p>
  
  <pre><code>{
     "name":"A name",
     "address":[
        {
           "country":"Brazil",
           "city":"Porto Alegre",
           "number":"000"
        }
     ]
  }
  </code></pre>
  
  <p>I was expecting that the table Customer would have the name and table Address would have the three properties plus the customer_id. But the customer_id right now is null.</p>
  
  <p>Any thoughts?</p>