title: Hibernate interface mapping without using annotation parameter "targetEntity"
body: <p>I am recently trying to introduce interfaces for some of my hibernate mapped entities and can not figure out how to configure the mapping.</p>
  
  <p>When I used the Interface without any further declarations, I always got the following Exception: </p>
  
  <pre><code>org.hibernate.MappingException: Could not determine type for: ...MyInterface 
  </code></pre>
  
  <p>Then I found out that everything works fine, when I define the targetEntity explicitly:</p>
  
  <pre><code>   @OneToOne(targetEntity=InterfaceImpl.class)
     private MyInterface myInterface;
  </code></pre>
  
  <p>Unfortunately, this solution does not work in my case: I can not define the targetEntity through annotation as I want to extract this class to an common external library that will not contain and even not know the final implementation of the interface.</p>
  
  <p>So is there an alternative way for declaring which implementation should be used, that I could use outside the extracted library? <img src="https://i.stack.imgur.com/BSKtz.png" alt="enter image description here"></p>