title: SpringBoot JPA Repository - get selected fields shows error "Column not found"
body: <h3>I want to <strong>fetch selected columns</strong>, preferably dynamically.</h3>
  
  <p>For now, I'm specifying static columns - id, title, description.</p>
  
  <p><strong>Category.java</strong></p>
  
  <pre><code>@Entity(name="Category")
  @Table(name="categories")
  public class Category {
  
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private long id;
     private String slug;
     private String title;
     private String description;
     private String preview_image;
     private int isFeatured;
  
     /*  Getters, setters etc */
  }
  </code></pre>
  
  <p><strong>CategoryRepository.java</strong></p>
  
  <pre><code>public interface CategoryRepository extends JpaRepository&lt;Category, Long&gt; {
  
      @Query(
          value = "SELECT id, title, description FROM categories", 
          nativeQuery = true
      )
      List&lt;Category&gt; findAll();
  }
  </code></pre>
  
  <p>This gives the error:</p>
  
  <blockquote>
    <p>Column 'is_featured' not found. Exception class: class
    org.springframework.dao.InvalidDataAccessResourceUsageException
    Exception [could not execute query; SQL [SELECT id, title, description
    FROM categories]; nested exception is
    org.hibernate.exception.SQLGrammarException: could not execute query]</p>
  </blockquote>
  
  <p>Any idea how this error can be resolved? I was thinking of using another model instead of <strong>Category</strong> but I need to make the fields dynamic later on. It's hard to make model class if I'm unaware of which fields to return.</p>
  
  <p>Also, is there a way I can make this <code>@Query</code> code dynamic such that it returns columns mentioned in parameter?</p>
  
  <p>Any help would be appreciated. Thanks in advance! :)</p>