Hi,
I’m trying to map a one to one database relation using myeclipse JPA generation tool. I have two tables, User and Manufacturer, and each one has it’s own primary key. User has a column id_manufacturer, which has a UNIQUE foreign key to the PK of Manufacturer, and may be null.
MyEclipse does generate the correct mappings, but each entity shows the following error: <In attribute ‘manufacturer’, the “mapped by” attribute ‘user’ also maps this attribute. Every relationship must have an owner.> And viceversa.
What am I doing wrong? I read that I can make a one-to-one relationship just adding a FK between primary keys of the two tables. I can’ t do this in my scenario because the FK is nullable.