title: JPA @Discriminator : how to cast one entity into another (based in discriminator)
body: <p>I am trying to have a User table with different types of users. I have a user class and then i extend it by Customer and Employee and Manager and admin and they all reside in the same table Users but they all have different discriminators. </p>
  
  <p>Now my application is such that first a user comes in and signs in as a User then he either becomes a customer or an employee. after a user has been created a customer or an employee, I want to change later on into manager or admin. how can I update that. how can I make the discriminator value different from what the entity originally had. </p>
  
  <p>I can use simple sql to update the DTYPE value in my table but I am pretty sure JPA must have some way that is more efficient. </p>
  
  <p>Or do I have delete the previous say "employee" user and create a new "admin" user. I tried instantiating the entity but it doesnt give me any method where I can update the Discriminator for that entity.</p>
  
  <p>Thanks
  Syed.</p>