title: Hibernate OnetoOne mapping with two lookup values
body: <p>I have a class which has two lookup values (one for name and one for type)</p>
  
  <pre><code>public class someAttr {
  private Long someAttrId;
  private Long projectId;
  
  private Lookup typeLookupValue;
  private Lookup nameLookupValue;
  
  getters &amp; setter...
  
  @OneToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
  @JoinColumn(name = "type_lk_id", referencedColumnName = "lk_id", insertable = false, updatable = false)
  public LookupValue getTypeLookupValue() {
      return typeLookupValue;
  }
  
  public void setTypeLookupValue(Lookup typeLookupValue) {
      this.typeLookupValue= typeLookupValue;
  }
  
  @OneToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
  @JoinColumn(name = "name_lk_id", referencedColumnName = "lk_id", insertable = false, updatable = false)
  public LookupValue getNameLookupValue() {
      return nameLookupValue;
  }
  
  public void setNameLookupValue(Lookup nameLookupValue) {
      this.nameLookupValue= nameLookupValue;
  }
  </code></pre>
  
  <p>The problem is that the same name_lk_id is shared between different someAttr object.
  Every time I run it I get:
  "org.hibernate.HibernateException: More than one row with the given identifier was found".</p>
  
  <p>Can I get nameLookupValue which belongs to a specific someAttr with a projectId instead of getting multiple Lookup object with the same "lk_id"??</p>