hi my tables are as follows:
1- medical_company:
This error is telling you that there is no column on the medical_company table called medical_company_id. The column on medical_company is just called id.
For those who ran into this problem and are using globally_quoted_identifiers
, this helped me:
Change
@JoinColumns({
@JoinColumn(name = "new_col_1", referencedColumnName = "ref_col_1"),
@JoinColumn(name = "new_col_2", referencedColumnName = "ref_col_2")
})
To
@JoinColumns({
@JoinColumn(name = "new_col_1", referencedColumnName = "`ref_col_1`"),
@JoinColumn(name = "new_col_2", referencedColumnName = "`ref_col_2`")
})
Notice the backtick wrapping the referencedColumnName
value.
I would remove the referencedColumnName attribute in MedicalCompany because you are naming the primary key field of AccountEntity. I think it is only necessary if you if it references a non-primary-key field.
@JoinColumn(name = "medical_company_id", referencedColumnName = "account_entity_id")