• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Entnibean removal using remove(Handle) method

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HFE says, you can use remove(Handle) method to remove the entity bean as well.My doubt is ..How can it be removed witout the key?

please explain?
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not? If you have handle you have have identifier to the bean you want to delete.

Hope it helps!
Gemini
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two possible scenarios that I could think of.

#1: the client invoked the remove(Handle h) method of an entity bean
#2: an EJB invoked the remove(Handle h) method of an entity bean

For #1:
The client would have a reference to the component interface. And from the component interface, it could invoke the getHandle method to obtain the handle of the entity bean. Then it could call the remove(Handle h) method on the home interface to remove the entity bean.

For #2:
Its rather similar to #1 just that our client becomes another EJB. This EJB could obtain a EJBObject through the same way as a client would. And the same procedure in getting the handle & then removing the bean.

So all in all, you need to know your EJBObject & EJBHome interfaces well enough. We can safely ignore local interfaces for obvious reasons.

Hope this helps.
 
Poo Kan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys

we can have EJBOject from getEJBObject() from Handle then can get the prmary key from getPrimaryKey() on EJBobject ...delete

Got cleared.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic