(...shrugging off the "people like you" comment because I'm magnanimous, a really swell guy, and overwhelmingly thankful that Hibernate exists...)
Thanks for the answer to my inquiry.
So, to restate, "bidirectionality" in the sense you describe it implies that the entities involved can exist independent of each other. Truly the sematics of relational database tables do not reinforce the parent-child relationship without introducing the foreign key contstraint.
In my specific case, a parent object contains an indexed list of child objects. "Bidirectionality" is what I'm actually shooting for - navigation from the child back to the parent. It's not offensive in this case, it's actually desirable.
I can understand why the "inverse=true" challenge exists. Since the sequencing is managed by ordinal position in the list, trying to manage the relationship from the child while simultaneously managing the ordering from the parent would be tricky.
But, why is a many-to-one reference back to the parent difficult from an ordered list? If I can attempt to answer my own question, is it because the presence of the many-to-one is itself a relationship that implies the relationship will be managed from the child side? Does that mean that bidirectional relationships are inherently inverse by nature? If you create a bidirectional association,
As to the NULL-ABLE foreign key on the child object, I guess you're right, I am offended by that... since it allows orphaned rows. Is that a prerequeisite condition for "bidirectionallity?" I know it's there to support the resequencing by deleting the relationship, then reassociating it when the object's position moves... It all directly mirrors the actions taken on the collection - true semantics! Still, seems icky to have a nullable foreign key on a child table.
|