-->
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: Problems with Collections
PostPosted: Thu Aug 19, 2004 2:52 pm 
Newbie

Joined: Mon Aug 09, 2004 3:35 pm
Posts: 1
Hibernate version: 2.1.6

Name and version of the database you are using: MySQL

If I have a class User that has a Set of Account objects and one Account has a Set of Stock objects. In order to save a new User I create a User I add 2 Accounts and in each Account I populate it with 10 Stocks each Account. How should I configure hibernate to only make sessios.save(user) ? Is this possible? or should I call session.save(account) and session.save(stock) all the objects in all Sets before saving the User ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 10:05 pm 
Beginner
Beginner

Joined: Mon Aug 09, 2004 12:31 pm
Posts: 47
Location: New York, NY, USA
1. What does your database look like?
2. What does your Hibernate mapping look like?

_________________
--DP


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 20, 2004 2:21 am 
Regular
Regular

Joined: Thu Aug 05, 2004 2:27 am
Posts: 54
Location: South Africa
have a look at "cascade" and you'll be able to just save user.
As dplass said consider your database schema and you'll map accordingly


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.