title: Hibernate @OneToOne gives error
body: <p>I have two entities <code>Item</code>.</p>
  
  <p>They are linked with entity <code>Link</code></p>
  
  <p>Each item can have many links, but link is a connection between two items.</p>
  
  <p>The problem is that the order of items is important. One is always the first <code>item</code> and other is second <code>item</code>.</p>
  
  <p>So my entities are like this:</p>
  
  <pre><code>Item
     private Collection&lt;Link&gt; links = new ArrayList&lt;Link&gt;();
      @OneToOne(cascade = CascadeType.ALL, mappedBy = ????)
      public Collection&lt;Link&gt; getLinks() {
         return links;
     }
  
  Link
  private Item firstItem;
  private Item secondItem;
  
  @OneToOne(mappedBy = ???)
  public Item getFirstItem() {
      return firstItem;
  }
  
  @OneToOne(mappedBy = ???)
  public Item getSecondItem() {
      return secondItem;
  }
  </code></pre>
  
  <p>What should i put to <code>mappedBy</code>?? Because pseudomapping for <code>Item</code> should me smthin like this:
  <code>mappedBy = { "firstItem", "secondItem") }</code></p>
  
  <p>At first I had no mapping and this gives error:</p>
  
  <pre><code> @OneToOne or @ManyToOne on foo.bar.Item.links references an unknown entity: java.util.Collection
  </code></pre>