title: How to make insert custom query in spring data jpa by using @Query annotation
body: <p>I am using mssql and spring data JPA, I want to insert new records to a table by using custom <code>@Query</code> annotation.</p>
  
  <pre><code>public interface CustomerRepository extends JpaRepository&lt;Customers, String&gt;{
  
  
      @Modifying
      @Query("insert into Customers values (?1 , ?2)")
      public void saveCutomer(int custId, Customer cust);
  
  }
  </code></pre>
  
  <p>Its giving error,</p>
  
  <p>Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting OPEN, found 'values' near line 1, column 23 [insert into Customers values (?1 , ?2)]</p>
  
  <p>I tried below also, same error.</p>
  
  <pre><code>@Modifying
      @Query("insert into Customers select ?1 , ?2")
      public void saveCutomer(int custId, Customer cust);
  </code></pre>