title: Hibernate inheritance: Schema-validation: missing column
body: <p>I am trying to implement inheritance in <code>Hibernate</code> with strategy <code>InheritanceType.JOINED</code>. However, when starting up the application it fails with the exception: </p>
  
  <pre><code>Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [EMAIL] in table [CLIENT]
  </code></pre>
  
  <p>I don't know why it is looking for the field <code>email</code> in the <code>Client</code> table, since the entity model specifies it is in the abstract superclass - <code>User</code>. Client has only fields specific for it.</p>
  
  <p>Here is how my entity model looks.</p>
  
  <p><strong>UserTable.java</strong></p>
  
  <pre><code>@Entity
  @Table(name = "USER")
  @Inheritance(strategy = InheritanceType.JOINED)
  public abstract class UserTable implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @Column(name = "USER_ID", nullable = false)
      private Long userId;
  
      @EmbeddedId
      private UserTablePK userTablePK;
  
      @Column(name = "PASSWORD", nullable = false, length = 512)
      private String password;
  
      @Column(name = "FIRSTNAME", nullable = false, length = 256)
      private String firstName;
  
      public UserTable() {
      }
  
      public UserTable(Long userId, String email, String password, String firstName) {
          this.userId = userId;
          this.userTablePK = new UserTablePK(email);
          this.password = HashCalculator.calculateSha256Hash(password, SecurityConstants.saltConstant());
          this.firstName = firstName;
      }
  // get, set
  }
  </code></pre>
  
  <p><strong>UserTablePK.java</strong></p>
  
  <pre><code>@Embeddable
  public class UserTablePK implements Serializable {
  
      @Column(name = "EMAIL", nullable = false, length = 256)
      private String email;
  
      public UserTablePK() {
      }
  
      public UserTablePK(String email) {
          this.email = email;
      }
  </code></pre>
  
  <p><strong>ClientTable.java</strong></p>
  
  <pre><code>@Entity
  @Table(name = "CLIENT")
  public class ClientTable extends UserTable implements Serializable {
  
      @Column(name = "WEIGHT")
      private String weight;
  
      @Column(name = "HEIGHT")
      private Integer height;
  
      public ClientTable() {
      }
  
      public ClientTable(Long clientId, String weight, Integer height, String email, String password, String firstName) {
          super(clientId, email, password, firstName);
          this.weight = weight;
          this.height = height;
      }
  }
  </code></pre>
  
  <p>Again, why is it looking for <code>email</code> field in the subclass table? I used Liquibase for Schema generation, and I checked - the schema is correct. There is no <code>email</code> in the <code>Client</code> table, it's only in the <code>User</code> table as it should be. The entity model corresponds to that, so what's the issue?</p>