• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error while updating in hibernate..

 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
when i retrive a data using hibernate and with the same instance when i try to update the new status , its throwing the following error.

and this my source code..




Can anybody help me in this issue.

thanks
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exception message says that you are attempting to modify an id field of an object; Hibernate will not allow you to do this.
 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.Can you exactly point were iam trying to do this.what i must do to avoid this issue.

thanks
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The matter will be clearer if you post the class definitions and mappings.
From what I can see now, the setCustomerAccountStatusName method is modifying a property mapped as ID.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic