-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Help a dumb guy map his relations...
PostPosted: Sat Jul 08, 2006 1:45 pm 
Newbie

Joined: Mon Jun 26, 2006 2:21 am
Posts: 2
Hello,


I'm stumped as to how to map the following relation, using annotations:


Code:
         |---|
         | A |
         ------  0..1       |---|
         | c  |-------|     | C |
         ------       |   1 -------
                      |-----| a   |
         |---|            1 |     |
         | B |        |-----| b   |
         ------  0..1 |     -------
         | c  |-------|
         ------


Read:

A has one C
B has one C
C has zero or one A, zero or one B


My eternal gratitude to anyone who can tell me the correct @OneToMany annotations for this case, then i'll be able to look at the manual again without losing my mind..

With backreference? Please?

ben(stupid)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 08, 2006 4:58 pm 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Use @OneToOne.

http://java.sun.com/javaee/5/docs/api/javax/persistence/OneToOne.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.