Hello all,
I have the following Table structure:
USER{
user_id int PK
session_info varchar
}
PROFILE{
user_id int PK/FK
...
}
I have been trying to use one-to-one mappings, at first uni-directional from the User object, so that my Profile object didn't have a reference to the User object. But since I wanted Hibernate to handle the keys, I had to make it bi-directional. My problem now is I can't seem to have a NULL Profile in the User object.
Do I need to use a many-to-one to achieve this?
This seems like a very simple mapping, but the most logical mapping (one-to-one) doesn't seem to fit.
And advice would be greatly appreciated.
Thanks,
Patrick
|