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.  [ 1 post ] 
Author Message
 Post subject: update a table generated by many to many relationship
PostPosted: Tue Mar 09, 2010 10:39 am 
Newbie

Joined: Fri Nov 20, 2009 9:26 am
Posts: 4
I have two tables Owner and Telephone linked by a many-to-many relationship with a table owner_telephone.
I have users rows populated in table Owner, I have telephones populated in table Telephone. I want to make the connection between tables using the owner_telephone table.

I use the following code:

ownerBean=(Owner)session.get(Owner.class, owner_id);
telBean=(Telefon)session.get(Telefon.class, tel_id);
ownerBean.getOwnerTelefon().add(telBean);
telBean.getOwners().add(ownerBean);
session.update(ownerBean);
session.update(telBean);
session.flush();

The problem is that the owner_telephone table is not updating at all.
How I should do to update the table owner_telephone?!?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.