Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Wrapp entity bean

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am 2 week old to EJB.
How do i wrap my entity bean with a session bean.
Eg : -
I am having a Entity bean EntityAccount.java and a session bean SessionAccount.java. Now i want to call the entity bean from this session bean. I don't want to use create method of entity bean. Is there any way by which i can call the entity bean without the create method ?
Please help me...
Janarthan S
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's first get some terminology straightened out so that we both know what we're talking about.
You don't wrap an entity bean in a session bean. Instead you just call the entity bean methods from the session bean. Going further, you have to call the create method of the entity bean if your intention is to create new entities. You can use the findXXX method if you don't want to create, but find some instances.
Now coming back to your question, you can call the entity bean methods from the sessionbean in the same way any other client would call the entity bean methods. Just do a JNDI lookup, downcast the bean ref and call the method.
Hope this answers your question.
 
Janarthan Sathiamurthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Ajith,
That cleared a lot of misconceptions. I will get back with more qns as i progress. Please provide me with solutions as this one.
Thanking u,
JAnarthan S
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic