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.
Please provide below details to help me investigate further –
1. Open MyEclipse IDE, from menu options click on MyEclipse > Installation Summary > Installation Details and copy and paste the same here
2. Attach screenshot of the issue to help me get a visual
3. Clear your .log file located at [your workspace dir]/.metadata/.log, replicate issue and attach file here
4. Could you send the schema for tables – User and Manufacturer?