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 Hibernate one-to-on id mapping issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate one-to-on id mapping issue" Watch "Hibernate one-to-on id mapping issue" New topic
Author

Hibernate one-to-on id mapping issue

Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
Hi all,
I am having a small mapping issue, and its pretty much down to what I am trying to do.

I have tableA and tableB, tableB has a foreign key to tableA, now the difficult comes in that I dont want to have a foreign key in tableA point to tableB, but most of the relationship will be seen from the perspective of tableA, that is to say, tableA has zero or one tableB.

Now even using the foreign-key attrubute in the mapping file, hibernate is still defaulting to match the primary keys of both tables involved.

Any ideas?
Is this possible?
Should I learn to spell?

Thanks
Gavin
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hibernate one-to-on id mapping issue
 
Similar Threads
Legacy and Hibernate1-2-M Mapping
Using JOINs
Hibernate mapping
FOREIGN KEY
Hibernate Composite & foreign key, please help