title: Handle different user types with Hibernate
body: <p>I'm starting a web app project with Spring framework + Hibernate. I want to model two different types of users in the application: <strong>doctors</strong> and <strong>patients</strong>. They have some common attributes like name, email, telephone number etc, but the doctors have more specific attributes like collegiate number, specialities, studies etc.</p>
  
  <p>This is an E-R model (Hibernate approach) simplified without attributes.</p>
  
  <p><a href="https://i.stack.imgur.com/c2A3G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c2A3G.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the relationships will become 1 to 1, but one of them will always be null. I've also though about using inheritance but I've never worked with it in Hibernate so I don't know which is the best approach and why. Which is the simplest and efficient way to go here?</p>
  
  <p>Thanks!</p>