-->
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.  [ 3 posts ] 
Author Message
 Post subject: one-to-one and tables
PostPosted: Tue Nov 08, 2005 5:45 am 
Beginner
Beginner

Joined: Tue Nov 01, 2005 5:21 am
Posts: 24
Hi,
I need two javabeans with the relationship that one contains another, which is one-to-one relationship. For example, I have two tables:
CREATE TABLE PERSONS(
PERSON_ID NUMBER(8) NOT NULL,
FIRST_NAME VARCHAR2(32) NOT NULL,
LAST_NAME VARCHAR2(32) NOT NULL
);
CREATE TABLE RESERVATIONS(
RESERVATION_ID NUMBER(8) NOT NULL,
PERSON_ID NUMBER(8) NOT NULL,
REGISTRATION_UTC DATE NOT NULL,
COMMENTARY VARCHAR2(200) NULL
);
In which:
one instance of Class Reservations contains an instance of persons.
How to design the one-to-one relationship between them?

Hope someone could help me.
Thanks.

Yulei


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 7:06 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
http://www.hibernate.org/hib_docs/v3/re ... n-onetoone


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 8:02 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Are you sure it is "one-to-one" relationship ? It looks like
"person" can contain any number of "reservations", so it is "one-to-many" and "many" side is optional.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.