-->
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.  [ 4 posts ] 
Author Message
 Post subject: Composition association between Classes
PostPosted: Tue May 17, 2005 8:52 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo togehter,
i have a composition association between e.g. class1 and class2. Now when i delete class1 from the databay, class2 has to be deletetd too from the database; but this should happen automatically.

How can I implement this situation?

Regards,
Martin


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 4:16 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo again,
can really nobody give me a hint?

Regrads,
Martin

P.S. I`m using hibernate annotations


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 4:20 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo again,
can really nobody give me a hint, how to set the annotations right? I-ve read somvewehere to use cascadetype.deleete-oprhan, but this function doesn't exist in hibernate annotations.

Regrads,
Martin

P.S. I`m using hibernate annotations


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 4:31 am 
Newbie

Joined: Mon Apr 04, 2005 6:01 am
Posts: 9
Location: INDIA
Hi Martin_L

You can always do this using Associations. Using associations if you insert the primary object it will automatically insert the secondary object.

and same for the dellete. As you required.

Look out the documentation of Hibernate team, In that check for Association you have three kinds of Association
1)one -to-one
2)one-to-many
3)many-to-many

Probably i think the Hibernate team will not answer for this basic question. Like we have read it by our self download the document from the below link
http://www.hibernate.org/hib_docs/v3/re ... ml_single/

You can see information for your problem or

you can also but book called Hibernate in Action,

but for ur requirement i think the document is more than enough

Regards
RamnathN


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