title: Retrieving only some part/values of entity from JPA query(Spring boot + MySQL)
body: <p>I'm writing JPA queries for some project and I don't need whole entity from database. So, how can I get only few field values of entity from JPA?</p>
  <p>For example, suppose I have User entity with userId, username, password, dateOfBirth, address and some other fields. So what I want is to return only username and password and no other details. So, how to achieve this in JPA Spring boot with MySQL database</p>