-->
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: Many-to-one / set
PostPosted: Fri Jun 30, 2006 5:30 pm 
Newbie

Joined: Mon Feb 20, 2006 9:08 am
Posts: 2
Hi,

I have a problem with Sets. After adding a "slave" record it doesnt always appear in the set. Should I reload the "master" record in order to refresh/ re-read its set? or is there a more efficient way.

Thanks,
Mike Burton.

Using:
Hibernate version:2
with: MySql 5.0.15:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 9:37 pm 
Newbie

Joined: Thu Jun 15, 2006 5:58 pm
Posts: 18
Could you be more specific, is that when you try to persist your data or when your are loading the object back.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 12:19 pm 
Newbie

Joined: Mon Feb 20, 2006 9:08 am
Posts: 2
I've persisted the data, I can see it in the SQL database.
But I dont see it in my data objects.
eg my main table is master and it has a set of slaves...
aMaster.getSlaves().size() has not been incremented as I would have expected.

I've tried manually doing it,
ie after I persisted by calling DAO.save(aSlave)
I then called aSlave.getMaster().add(aSlave).

Having to do this doesnt seem right somehow, and it doesn't work for the first slave I add for a given master (it only works for subsequent ones).

_________________
Rgds, Mike Burton


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.