title: How to get the specific fields by API Spring Boot
body: <p>I need to REST the request by the GET to transfer to the parameters of the field that I want to get from the database sql (from hibernate) </p>
  
  <pre><code>@GetMapping("/product")
  public Object getProducts(@RequestParam(name = "fields") String fields) {
     // how?
  }
  
  
  
  @Repository
  public interface ProductRuRepository extends JpaRepository&lt;Product, Long&gt; {
  @Query("SELECT ?1 FROM Product p")
  List&lt;Product&gt; findByFields(String fields);
  }
  </code></pre>
  
  <p>I'm waiting to get the fields that I passed to the parameter.
  But the project does not compile</p>