title: Insert a new row using JpaRepository in java
body: <p>I am very new to spring JPA. I have following entity class which I want to insert in table:</p>
  
  <pre><code>@Entity
  @Table(name = "test")
  public class Test {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private int id;
  
      @Column(name = "user")
      private String user;
  }
  </code></pre>
  
  <p>I have an empty table named <code>test</code>. I have multiple objects of Test and I want to insert it to the table. For this I have created a repo class:</p>
  
  <pre><code>@Repository("testRepo")
  public interface TestRepo extends JpaRepository&lt;Test, String&gt; {
  //write insert query    
      @Modifying
      @Query(//What insert query I should write)
      void insertData(@Param("id") String id);
  
  }
  </code></pre>
  
  <p>I have searched but getting only options for update query.</p>