title: How to create a non-persistent Field in an JPA Entity?
body: <p>I have an Entity called <code>Users</code> that have <em>login, name and department</em> as fields that are stored in <code>Users</code> table.</p>
  
  <p>My <code>Spring-Boot</code> configuration defines the departments that gives the <strong>system manager role</strong> for users in this application.</p>
  
  <p>The key problem is that I want the login <code>end-point</code> to return the User data with the additional information that he/she is or is not a system manager.</p>
  
  <p>I think that this information should be in the User class, but I do not want this information to be stored in the database along with other fields as the management departments may change or the user my change from one department to another that does not manage the system.</p>
  
  <p>(<em>Edit</em>) I will define this <em>IsManager</em> field when user request login(): I will get user's <code>department</code> field and check against <code>managerDepartment</code>'s list to set it to true ou false.</p>
  
  <p>So the question is if it is right to put that information in a non-persistent field in the entity class (and how to do that) or if I may change the ResponseEntity in the rest method to add the additional information (and how) ?</p>