• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Entnibean removal using remove(Handle) method

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • 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.
 
Have you no shame? Have you no decency? Have you no tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic