title: How to save multiple tables using Spring Boot JpaRepository and their MySQL script
body: <p>//Restaurant entity class</p>
  
  <pre><code>public class Restaurant {
  
      @GeneratedValue
      @Id
      private Long id;
  
      @NotBlank
      @Size(min = 3, max = 50)
      private String name;
  
      @OneToMany(mappedBy = "restaurant", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
      private List&lt;Menu&gt; menus;
  }
  </code></pre>
  
  <p>//Menu entity class</p>
  
  <pre><code>public class Menu {
  
      @Id
      private Long id;
  
      @NotBlank
      @Size(min = 3, max = 50)
      private String type;
  
      @NotBlank
      private String info;
  
      @ManyToOne
      @JoinColumn(name = "restaurant_id")
      private Restaurant restaurant;
  }
  </code></pre>
  
  <p><strong>I have two entities: one is Restaurant and another is menu with end points</strong></p>
  
  <p>/restaurants</p>
  
  <pre><code>GET - get all restaurants
  POST - upload restaurant
  PUT - Update restaurant
  DELETE - delete all restaurant
  </code></pre>
  
  <p>/restaurants/{id}</p>
  
  <pre><code>GET - get a restaurant by id
  DELETE - delete a restaurant by id
  </code></pre>
  
  <p>/restaurants/{id}/menus/</p>
  
  <pre><code>GET - get all menus in the restaurant specified by id
  POST - add new menus in the restaurant specified by id
  DELETE - delete all menus in the restaurant specified by id
  </code></pre>
  
  <p>Now could you please check weather the entity class are correct and please provide me with the MySQL script to the above entities</p>