• Post Reply Bookmark Topic Watch Topic
  • New Topic

Wrapp entity bean

 
Janarthan Sathiamurthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!