Manu Navarro commented on Bug HHH-6221

There is a way to bypass the validation and get it to work, thus indicating the column is a "@JoinColumnsOrFormulas" then put the solution:

Error:

@ManyToOne
@JoinColumns(value = { @JoinColumn(name = "country_code", referencedColumnName = "country_code"), @JoinColumn(name = "zip_code", referencedColumnName = "code")})
private Zip zip = null;

@ManyToOne
@JoinColumns(value = { @JoinColumn(name = "country_code", referencedColumnName = "country_code", insertable = false, updatable = false), @JoinColumn(name = "state_code", referencedColumnName = "state_code"), @JoinColumn(name = "city_name", referencedColumnName = "name")})
private City city = null;


OK:

@ManyToOne
@JoinColumns(value = { @JoinColumn(name = "country_code", referencedColumnName = "country_code"), @JoinColumn(name = "zip_code", referencedColumnName = "code")})})
private Zip zip = null;

@ManyToOne
@JoinColumnsOrFormulas(value = { @JoinColumnOrFormula( @JoinFormula(value = "country_code", referencedColumnName = "country_code") ), @JoinColumnOrFormula( @JoinColumn(name = "state_code", referencedColumnName = "state_code"), @JoinColumnOrFormula( @JoinColumn(name = "city_name", referencedColumnName = "name") ) })
private City city = null;

Regards,

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira