File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes bi-directional, uni-directional, curious? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "bi-directional, uni-directional, curious?" Watch "bi-directional, uni-directional, curious?" New topic

bi-directional, uni-directional, curious?

Matt Horton
Ranch Hand

Joined: Feb 06, 2002
Posts: 107
in a different thread (that I didn't want to derail) a user asked a question about using bi-directional or uni-directional links. uni-directional links are an oddity in my mind, so I was perplexed when I read the following exchange:

in which Gavin suggests that a user split his/her model from a bi-directional association into 2 uni-directional associations (to accomodate the list-index element for lists).

I don't really know what this means, so I have to ask: what are 2 uni-directional links? If you put one uni-directional link in one hbm.xml file and another uni-directional link in a separate file, haven't you accidentally created a bi-directional link?? What am I missing? I'll go on a run in your name if you will enlighten me.
[ March 13, 2007: Message edited by: Matt Horton ]
Matt Horton
Ranch Hand

Joined: Feb 06, 2002
Posts: 107

omg, I did it. now I will bathe in the love that must cometh down from Christian Bauer. I read and read, and iteratively guessed and then the hibernate writers were pleased.

pththt. Nice docs. Better product.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Sounds like a personal problem to me. Whichever way you want to go, is fine. Just know if you need to come out of the closet, we will fully support you.

Congrats on your successful mapping


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Matt Horton
Ranch Hand

Joined: Feb 06, 2002
Posts: 107
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

I prefer unidirectional. I think bidirectional is the preference of database centric folks. In the end it dont matter because you can change back and forth without altering the schema.
I agree. Here's the link:
subject: bi-directional, uni-directional, curious?
It's not a secret anymore!