URGENT: @OneToOne mapping NOT on PK/FK

View: New views
1 Messages — Rating Filter:   Alert me  

URGENT: @OneToOne mapping NOT on PK/FK

by bmelloni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry about the Urgent, I am supposed to finish this today.

1) I am mapping 2 tables (employee and person) that I cannot change.  Both tables contain an employeeId and have a 1-1 relationship based on it, but the employeeId column is NOT the PK in either table.  The @OneToOne mapping seems to require something like employee.personID to map to the PK of person.

How can I map the relationship based on employeeId column?  

2) Again, in the employee table, I have a supervisorId column (this one does contain the PK).

How do I map the relationship from employee to employee based on the supervisorId?