• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in Updating the Child Table records

 
Amos Matt
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using a User:Table which has a child table UserRole:Table

I have inserted a record in User, two child records for the same UserRole using a test client. But while updating the the same user, i gave only one record for the child table.

But i can one record is updating and another is still there. Can you please tell me how can i solve the problem.

Thanks in adv.,
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andy, I am going to move this to the ORM forum.

Mark
 
Halcon Guatemala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andy, could you show us more about your design or mapping resources?
Thanks in advance
 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using JPA or hibernate.
here are some using for both of them
http://www.makemyinfo.com/Tutorial.do?action=first

Rashid
 
karthick swami
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First read(load) two records of UserRole ,have one record(which you needed to update) and make the other record null and set into the User object.Do a save of User object atlast.

By this way the unwanted record of user role will not exist.

Hope this helps.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!