title: Spring Data JPA how to pass a variable by using @repository
body: <p>Thank U, guys! I have found the solution:</p>
  
  <pre><code>@Repository
  public interface BookRepository extends JpaRepository&lt;Book, Integer&gt;{       
      @Query(value = "select * from Book where find_in_set(:market,market)", nativeQuery = true)
      public List&lt;Book&gt; findBooksByMarcket(@Param("market") String market);
  }
  </code></pre>
  
  <p><strong>Original question</strong></p>
  
  <p>I'm using the @Query annotation to create queries by using the JPA query language and to bind these queries directly to the methods of my repository interface.</p>
  
  <p>My database is created correctly and I'm successful to create some queries except this one:</p>
  
  <pre><code>@Repository
  public interface BookRepository extends JpaRepository&lt;Book, Integer&gt;{       
      @Query("select b from Book b where find_in_set(:market,b.market)")
      public List&lt;Book&gt; findBooksByMarcket(@Param("market") String market);
  }
  </code></pre>
  
  <p>I can get the correct result by using the find_in_set function when I check it though MySql. But I cannot reach to pass a variable in java. I have searched though the internet but I cannot find the correct format for it.</p>
  
  <p>please help and thank you guys!</p>