title: Hibernate don't insert nested object
body: <p>I am trying to save in data base nested objects using post request.</p>
  
  <p>I have OneToMany relation. One Auto service -> many services.</p>
  
  <p>Dependency:
  AutoService:</p>
  
  <pre><code>@JsonManagedReference
  @OneToMany(mappedBy = "autoService", fetch = FetchType.EAGER)
  private List&lt;Service&gt; services = new ArrayList&lt;Service&gt;();
  </code></pre>
  
  <p>Service:</p>
  
  <pre><code>@JsonBackReference
  @ManyToOne
  @JoinColumn(name = "autoServiceId", nullable = false)
  private AutoService autoService;
  </code></pre>
  
  <p>Here is the usage of Repository class:</p>
  
  <pre><code>public AutoService save(AutoService service) {
          return repository.saveAndFlush(service);
      }
  </code></pre>
  
  <p>Here is POST request:</p>
  
  <pre><code>@RequestMapping(value = "/saveService", method = RequestMethod.POST)
      @ResponseBody public AutoService saveAutoService(@RequestBody AutoService autoService){
          return dataBaseService.save(autoService);
      }
  </code></pre>
  
  <p>As you can see i am get an object:</p>
  
  <p><a href="https://i.stack.imgur.com/rGPrR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rGPrR.png" alt="enter image description here"></a></p>
  
  <p>But then in console I am getting next message:</p>
  
  <pre><code>Hibernate: insert into AutoRate (imageURL, mapCoordinate, phoneNumber, serviceName, websiteURL, id) values (?, ?, ?, ?, ?, ?)
  </code></pre>
  
  <p>For some reeason hibernate don't save nested object - <code>Service</code>.</p>
  
  <p>Can any body help me with this ?</p>