title: Loading OneToMany mapping using @JoinColumnsOrFormulas
body: <p>Here are the two entities I'm looking to create a join on:</p>
  
  <pre><code>public class CustomFieldValue {
  private Integer           id;
  private Integer           identifier;
  private String            entityName;
  private String            name;
  private String            value;
  
  public CustomFieldValue() {
  }
  
  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "id", unique = true, nullable = false)
  public Integer getId() {
      return this.id;
  }
  
  public void setId(Integer id) {
      this.id = id;
  }
  
  @Column(name = "identifier", nullable = false)
  public Integer getIdentifier() {
      return identifier;
  }
  
  public void setIdentifier(Integer identifier) {
      this.identifier = identifier;
  }
  
  @Column(name = "entity_name", nullable = false)
  public String getEntityName() {
      return entityName;
  }
  
  public void setEntityName(String entity) {
      this.entityName = entity;
  }
  
  @Column(name = "name")
  public String getName() {
      return value1;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  @Column(name = "value")
  public String getValue() {
      return value;
  }
  
  public void setValue(String value) {
      this.value = value;
  }
  }
  
  
  class Order 
  {
      int id;
      ...
      Set&lt;CustomFieldValue&gt; customFieldValues;
  
  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "id", unique = true, nullable = false)
  public Integer getId() {
      return this.id;
  }
  
  public void setId(Integer id) {
      this.id = id;
  }
  
  public void setCustomFieldValues(Set&lt;CustomFieldValue&gt; customFieldValues) {
      this.customFieldValues = customFieldValues;
  }
  
  @OneToMany(fetch = FetchType.EAGER)
  @JoinColumnsOrFormulas({
          @JoinColumnOrFormula(column = @JoinColumn(name = "identifier", referencedColumnName = "id", insertable = false, updatable = false)),
          @JoinColumnOrFormula(formula = @JoinFormula(value = "entityName='Order'")) })
  public Set&lt;CustomFieldValue&gt; getCustomFieldValues() {
      return customFieldValues;
  }
  }
  </code></pre>
  
  <p>I want to create a join when the identifier in the CustomFieldValue is equal to Order id and entityName is 'Order'. 
  I am getting an error on this line:</p>
  
  <pre><code>@JoinColumnOrFormula(formula = @JoinFormula(value = "entityName='Order'"))
  </code></pre>
  
  <p>It says 'cannot find logical name in entity Order', the only other attribute present in @JoinFormula annotation is referencedColumnName, which I cannot provide.</p>
  
  <p>Any ideas how this can be achieved?</p>