title: org.hibernate.AnnotationException: referencedColumnNames referencing not mapped to a single property
body: <p>I ran into the below exception while mapping a one-to-one between 2 entities. The 1 first entity has embedded composite key. The second entity also has embedded composite key. The tables are part of legacy system. Data is flat, relations are not well defined. Please help.</p>
  
  <pre><code>Caused by: org.hibernate.AnnotationException: referencedColumnNames(FLAG_NAME) of net.javabeat.spring.model.ReferralsM.mnEditFlag referencing net.javabeat.spring.model.MnEditFlag not mapped to a single property
      at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:205)
      at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:116)
      at org.hibernate.cfg.Configuration.processEndOfQueue(Configuration.java:1515)
      at org.hibernate.cfg.Configuration.processFkSecondPassInOrder(Configuration.java:1440)
      at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1358)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1727)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1778)
      at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:247)
      at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:373)
      at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:358)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
      ... 34 more
  </code></pre>
  
  <p>Here is my one to one mapping in the main/parent table.</p>
  
  <pre><code>@OneToOne(targetEntity = MnEditFlag.class, fetch = FetchType.LAZY)
  @JoinColumn(name = "REFFLG", referencedColumnName = "FLAG_NAME", insertable = false,     updatable = false)
  MnEditFlag mnEditFlag;
  </code></pre>