I'm trying to overcome a problem joining on a table with a composite key using only one of the fields. I've seen some examples using @JoinFormula to get around this, and I upgraded to beta to take advantage of that. However, many of my cases are ManyToMany, and I can't find a way to annotate this. Here's an example:
@ManyToMany @JoinTable(name="TBLCUSTOMER_CONTACT", joinColumns=@JoinColumn(name="CUSTOMER_ID"), inverseJoinColumns=@JoinColumnsOrFormulas({ @JoinColumnOrFormula(column=@JoinColumn(name="CONTACT_ID")), @JoinColumnOrFormula(formula=@JoinFormula(value="0" referencedColumnName="RECORD_SUFFIX")) }) )
obviously, this doesn't work because inverseJoinColumns is expecting a JoinColumn[], rather than a JoinColumnsOrFormulas. Is there a proper way to annotate this?
Thanks, Ian
|