As far as I know, using a pivot table (as for a many-to-many relationship) would be the right way.
Something like this should work:
@Entity
public class Invoice
{
@JoinTable(name = "invoice_vendor", joinColumns = {
@JoinColumn(name = "invoice", referencedColumnName = "vendor_id")}, inverseJoinColumns = {
@JoinColumn(name = "vendor", referencedColumnName = "id")})
@OneToOne
private Vendor vendor;
}
If the invoice_vendor table has an integer identifier in the id column and a varchar link in the vendor_id column.
, ManyToOne , , .