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?!?
|