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: How to manage associations between tables?
PostPosted: Wed Jun 04, 2008 8:40 am 
Newbie

Joined: Wed Jun 04, 2008 8:31 am
Posts: 1
Hi,

can anyone tell me , How to manage associations between the following tables? and how to map them in xxxx.hbm.xml file ?

CREATE TABLE part(
Part_no NUMBER PRIMARY KEY,
Part_desc VARCHAR2(200) NOT NULL );

CREATE TABLE item (
Item_no NUMBER,
Part_no NUMBER,
Item_desc varchar2(200) NOT NULL,
CONSTRAINT fk_item_part FOREIGN KEY (part_no) REFERENCES PART (part_no),
CONSTRAINT pk_item PRIMARY KEY (item_no, part_no) );

Regards,
Srinivas


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 9:57 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
If you're struggling with the mapping, you might want to look at Hibernate Tools. There are eclipse plug-ins that will do this type of bottom-up database mapping for you, and create the hbm files you need.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.