title: How to select only certain fields with Quarkus Panache?
body: <p><code>Quarkus</code> simplifies Hibernate ORM mappings with <code>Panache</code>.</p>
  
  <p>Here is an example of my <code>entity</code> and <code>PanacheRepository</code>:</p>
  
  <pre><code>@Entity
  public class Person {
      @Id @GeneratedValue private Long id;
      private String firstName;
      private String lastName;
      private LocalDate birth;
      private Status status;
  }
  
  @ApplicationScoped
  public class PersonRepository implements PanacheRepository&lt;Person&gt; {
  
     // example
     public Person findByName(String name){
         return find("name", name).firstResult();
     }
  
  
     // ! and this is what I tried, but it's not possible to do it this way
     // all the methods return Person or something of type Person like List&lt;Person&gt;
     // so basically this won't even compile
     public List&lt;String&gt; findAllLastNames() {
         return this.find("select p.lastName from Person p").list();
     }
  
  }
  </code></pre>
  
  <p>All the guides explain how to write different queries, but is not clear how to select only certain attributes.</p>
  
  <p>If I don't need the whole <code>Person</code> object, but rather the <code>lastName</code> of all persons in my DB?</p>
  
  <p>Is it possible to select only certain attributes with <code>Quarkus Panache</code>?</p>