title: @PrePersist with entity inheritance in JPA with hibernate provider
body: <pre><code>@Entity
  @Inheritance(strategy = InheritanceType.Joined)
  public class SiteMessage implements Identifiable{
      private String uid;
      @PrePersist
      public void onCreate(){
          uid = "12344"; // Actually we generates new value here
          System.out.println("Executed onCreate1");
      }
  }
  
  @Entity
  @Table(name = "feedback")
  public class Feedback extends SiteMessage {
      @PrePersist
      @Override
      public void onCreate(){
          super.onCreate();
          System.out.println("Executed onCreate2");
      }
  }
  </code></pre>
  
  <p>When i save SiteMessage entity then i see: Executed onCreate1. When i try to save the Feedback entity, onCreate() method of Feedback or SiteMessage  is not getting executed. </p>
  
  <p>If I store/persist instances of the Base class to the database, everything works fine. The dates are getting updated. But now, if I want to persist a child instance, the database throws the following exception:</p>
  
  <p><strong>org.hibernate.exception.ConstraintViolationException: Column 'uid' cannot be null</strong></p>
  
  <p>So, in my opinion, this is caused because in Child the method "@PrePersist protected void updateDates()" is not called/invoked before persisting the instances to the database.</p>
  
  <p>Any help is appreciated. Thanks in advance.</p>