title: HQL to a custom class with entity, selecting only id then querying n+1
body: <p>I'm using HQL Query and i'm trying to pass an entity object to the custom class(view), it's just selecting my entity Id and then my entire entity, making the query N+1, it's not so good.</p>
  
  <p>Stack: Spring Boot v2.2.5.RELEASE</p>
  
  <p>It's a bug of Hibernate ?<br/>
  Does anyone know any way to resolve this ?<br/>
  I'm trying to not map each column of entity in my custom class.<br/>
  Follow the examples below:</p>
  
  <pre><code>@Data
  @Entity
  @EqualsAndHashCode(callSuper = true)
  public class Book extends MyModel {
  
      @Column(name = "title")
      private String title;
  
      @Column(name = "some_column_fetch")
      private String someColumnFetch;
  
      @ManyToOne(cascade = CascadeType.ALL)
      private Author author;
  
  }
  </code></pre>
  
  <pre><code>@Data
  @Entity
  @EqualsAndHashCode(callSuper = true)
  public class Magazine extends MyModel {
  
      @Column(name = "title")
      private String title;
  
      @Column(name = "some_column_fetch")
      private String someColumnFetch;
  
      @ManyToOne(cascade = CascadeType.ALL)
      private Author author;
  
  }
  
  </code></pre>
  
  <pre><code>@Data
  public class BookView {
  
      private final Book book;
  
      private final Magazine magazine;
  
  }
  </code></pre>
  
  <pre><code>public interface BookRepository extends JpaRepository&lt;Book, UUID&gt; {
  
      @Query("SELECT new com.example.demo.views.BookView(book, magazine) " +
              " FROM Book book" +
              " LEFT JOIN Magazine magazine ON book.someColumnFetch = magazine.someColumnFetch")
      List&lt;BookView&gt; findViews();
  
  }
  </code></pre>