title: How to not show password with .find JPA
body: <p>I have a question. I have a User entity with a password in it. I have a function that returns a User object:</p>
  
  <pre><code>public User findUser(long id) {
      return em.find(User.class, id);
  }
  </code></pre>
  
  <p>This code returns a User with all his parameters, password included. How can I remove the password from my returned entity? Because I need to send back a Json response with the user object. 
  I've thought about something like that, but it's ugly...</p>
  
  <pre><code>public User findUser(long id) {
      User user = new User();
      find = em.find(User.class, id);
      user.setUsername(find.getUsername());
      user.setMail(find.getMail());
  
      return user;
  }
  </code></pre>
  
  <p>Thanks for your advice.</p>