File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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:

http://forums.hibernate.org/viewtopic.php?t=943384&highlight=bidirectional+listindex&sid=1e19f557855a43d8854db19a7f411d27

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
der!

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
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: http://aspose.com/file-tools
 
subject: bi-directional, uni-directional, curious?