I'm just starting out, testing Hibernate, and attempting to model a parent/child relationship onto a legacy database.
My schema looks like this:
Code:
table parent
parentid
<data fields>
table child
parentid
childid
<data fields>
In the child table, the key is (parentid, childid). Note that childid is not unique across the table; it numbers 1...n for each instance of parent.
I'm not sure how to model this properly for a one-to-many inverse relationship. I've gotten a simple parent->child set to work, but not a relationship where the child can access its parent.
Any samples out there? I understand that surrogate keys would be best, but adding them is not an option right now.
Thanks,
Steve