-->
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 have One to many relation??
PostPosted: Tue Nov 30, 2004 6:38 am 
Beginner
Beginner

Joined: Wed Jul 21, 2004 7:48 am
Posts: 21
Hi all,
I have a class that is going to contain another class (B) instances.
Consider the example below

class A{

List bs; //List containing objects of class B

//and i have getter and setter methods for this attribute

}


Class B{
String a;
//get and set methods

}

So if I say session.save(A) does it save the Bs instances also or I need to save B instances first and this save saves A and the link between the two classes.

[b]Hibernate version: 2.1.2

which XDoclet tag to use? plz help

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 6:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Read the parent child information in the docs and wiki.
Have a look at the many samples that are linked from the wiki. Many of them have XDoclet usage. In anycase, they follow the mapping tags closely so once you understand the basic HBM tags then XDoclet logically follows.


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.