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
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.
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).