• Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity from Session

 
Arundhathi Menon
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!
Cld u pls help me as to how invoke an entity bean from a session bean.
Thank u
 
Sergiu Truta
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Context context = new InitialContext();
EntityLocalHome entityLocalHome = (EntityLocalHome)context.lookup("JNDINameForTheLocalHomeInterface");
EntityLocal entityLocal = entityLocalHome.create(entityPK);
OR
EntityLocal entityLocal = entityLocalHome.findByPrimaryKey(entityPK);

entityLocal.anyDefinedMethod();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!