title: Spring Data JPA / Hibernate "Unable to locate Attribute with the given name"
body: <p>We have a problem with a Spring Web Application and Hibernate. It is written in Kotlin.
   We have an abstract Entity</p>
  
  <pre><code>@Inheritance(strategy = InheritanceType.JOINED)
  abstract @Entity class ContactLogEntry protected constructor() {
  
      @GeneratedValue @Id val id: Long = 0
  
  
      @ManyToOne
      @JoinColumn
      protected lateinit var _contact: AbstractContact
      open val contact: AbstractContact? get() = _contact
  
    @ManyToOne
      protected var _user: User? = null
      open val user: User? get() = _user
  </code></pre>
  
  <p>And some of those:</p>
  
  <pre><code>@Entity class MailLogEntry() : ContactLogEntry() {
  
  
      override var contact: Lead
          get() = super.contact as Lead
          set(value) {
              super._contact = value
          }
  
   override var user: Telephonist
          get() = super.user as Telephonist
          private set(value) {
              super._user = value
          }
  </code></pre>
  
  <p>Note that "Lead" inherits directly from "AbstractContact". The Problem is with the property <code>contact</code>. The User Property, where Telephonist inherits directly from User, works fine.</p>
  
  <p>We get <code>Unable to locate Attribute  with the the given name [contact] on this ManagedType (PATH to ContactLogEntry)</code></p>
  
  <p>We did it the same way before, where it works. Really no clue whats wrong.</p>