title: Trouble with hibernate inheritance
body: <p>please help me with such issue - i have abstract class 
  and two child:</p>
  
  <pre><code>@Table(name = "abstract_partner")
  @Inheritance(strategy= InheritanceType.JOINED)
  public abstract class AbstractPartner {
  
  @Id
  protected Long id;
  protected String name;
  protected String endpoint;
  protected String code;
  @Column(name = "api_key")
  protected String apiKey;
  
  public Long getId() {
      return id;
  }
  
  public void setId(Long id) {
      this.id = id;
  }
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public String getEndpoint() {
      return endpoint;
  }
  
  public void setEndpoint(String endpoint) {
      this.endpoint = endpoint;
  }
  
  public String getCode() {
      return code;
  }
  
  public void setCode(String code) {
      this.code = code;
  }
  
  @Override
  public abstract boolean equals(Object o);
  
  @Override
  public int hashCode() {
      return Objects.hash(id);
  }
  
  public String getApiKey() {
      return apiKey;
  }
  
  public void setApiKey(String apiKey) {
      this.apiKey = apiKey;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>CustomerPartnerGroupEntity</p>
  
  <pre><code>@Entity
  @Table(name = "customer_partner_group")
  
  public class CustomerPartnerGroupEntity extends AbstractPartner{
  
  @Override
  public boolean equals(Object o) {
      if (this == o) return true;
      if (!(o instanceof CustomerPartnerGroupEntity)) return false;
      CustomerPartnerGroupEntity that = (CustomerPartnerGroupEntity) o;
      return Objects.equals(id, that.id);
  }
  }
  </code></pre>
  
  <p>NetworkPartner</p>
  
  <pre><code>@Entity
  @Table(name = "network_partners")
  
  public class NetworkPartner extends AbstractPartner{
  
  @OneToOne(mappedBy = "partner", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
  @JsonIgnore
  private NetworkPartnerConfiguration configuration;
  
  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "payment_provider_id")
  @JsonIgnore
  private PaymentProviderEntity paymentProvider;
  
  
  @Override
  public boolean equals(Object o) {
      if (this == o) return true;
      if (!(o instanceof NetworkPartner)) return false;
      NetworkPartner that = (NetworkPartner) o;
      return Objects.equals(id, that.id);
  }
  
  public NetworkPartnerConfiguration getConfiguration() {
      return configuration;
  }
  
  public void setConfiguration(NetworkPartnerConfiguration configuration) {
      this.configuration = configuration;
  }
  
  public PaymentProviderEntity getPaymentProvider() {
      return paymentProvider;
  }
  
  public void setPaymentProvider(PaymentProviderEntity paymentProvider) {
      this.paymentProvider = paymentProvider;
  }
  }
  </code></pre>
  
  <p>and try to realise inheritance via Hibernate with strategy - JOINED
  but when i use this strategy i receive exception:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error     creating bean with name 'entityManagerFactory' defined in class path resource [common-beans.xml]: Invocation of init method failed; nested exception is java.util.NoSuchElementException
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:960)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:749)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
  at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
  at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
  at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
  at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
  at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
  at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
  ... 24 more
  Caused by: java.util.NoSuchElementException
  at java.util.ArrayList$Itr.next(ArrayList.java:854)
  at org.hibernate.cfg.annotations.TableBinder.linkJoinColumnWithValueOverridingNameIfImplicit(TableBinder.java:487)
  at org.hibernate.cfg.PkDrivenByDefaultMapsIdSecondPass.doSecondPass(PkDrivenByDefaultMapsIdSecondPass.java:54)
  at org.hibernate.cfg.Configuration.processSecondPassesOfType(Configuration.java:1386)
  at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1337)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1730)
  at org.hibernate.ejb.EntityManagerFactoryImpl.&lt;init&gt;(EntityManagerFactoryImpl.java:94)
  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
  at org.springframework.orm.jpa.vendor.SpringHibernateEjbPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateEjbPersistenceProvider.java:51)
  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
  ... 39 more
  </code></pre>
  
  <p>strange thing - if i choose another strategy(SINGLE TABLE or TABLE_PER_CLASS) error don't appear</p>