• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to modify a CMP-Entity-Bean?

 
Oliver Rensen
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

when I want to modify a record in the database, I must remove() the Entity-Bean and create() a new one. Is this correct, or does exist any possibility to make an update on a CMP-Entity-Bean?

Thanks in advance.

Regards,
Oliver
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you need to do is update the persistent fields by using the abstract setter methods. This is done in the ejbStore method. The container will deal with everything else.
 
Oliver Rensen
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roger, thanks a lot. Your solution works!
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!