-->
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: Nested Domain Objects
PostPosted: Tue Jun 24, 2008 2:55 am 
Newbie

Joined: Tue Jun 17, 2008 11:01 pm
Posts: 16
All friends…

I have two classes promotion and grade

Class Grade {
private long gradeId;
private String gradeName;

getters/setters………….
}


Class Promotion {
private long promotionId;
private String promotionName;
private Grade grade;

getters/setters………….
}


Grade table
GRADE_ID
GRADE_NAME

Promotion Table
PROMOTION_ID
PROMOTION_NAME
GRADE_ID


Can any one suggest.. how can I map Promotion class in promotion.hbm.xml
Difficulty with me is that Promotion class contains Grade object … I just need its GradeId only to promotion table..

Thanks to all


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 24, 2008 10:09 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Here's a little tutorial on how to map one to one associations with Hibernate. The example uses JPA, but the ideas are equivalent to using mapping files:

http://jpa.ezhibernate.com/Javacode/learn.jsp?tutorial=17mappingonetooneassociations

_________________
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  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 12:57 pm 
Newbie

Joined: Tue Jun 17, 2008 11:01 pm
Posts: 16
Thanks ..

Actually i read the article itz very good..
http://jpa.ezhibernate.com/Javacode/lea ... sociations

but i cann't implement this with
hibernate xml mapping will u please give some related example


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.