title: MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
body: <p>I am getting an error .
  <strong>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order (id)' at line 1</strong>
   Not sure why . Can anyone help ?
  Below are entities. Order can have many products. Products can be associated to many orders and a restaurant has one to one relationship with product</p>
  
  <pre><code>    @Entity
  public class Order {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
  
      @ManyToMany
      @JoinTable(name = "order_product", joinColumns = @JoinColumn(name = "order_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "product_id", referencedColumnName = "id"))
      private Set&lt;Product&gt; products = new HashSet&lt;&gt;();
  
      }
  
  
      @Entity
  public class Product {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
  
      @ManyToOne
      @JoinColumn(name = "restaurant_id", referencedColumnName = "id",  insertable=false, updatable=false)
      @JsonBackReference
      private Restaurant restaurant;
      private int restaurant_id;
      private String name;
      private String description;
      private float price;
      private float discount;
  
      @ManyToMany(fetch = FetchType.EAGER)
      @JsonIgnore
      private Set&lt;Order&gt; orders = new HashSet&lt;&gt;();
      }
  
  
  
   @Entity
  public class Restaurant {
      @Id
      @GeneratedValue
      private int id;
      @NotNull
      private String name;
      private String city;
      private String address;
      private String email;
      private String phone;
  
      @OneToMany(fetch = FetchType.LAZY, mappedBy = "restaurant", cascade = CascadeType.ALL)
      @JsonManagedReference
      private List&lt;Product&gt; menu;
  }
  </code></pre>