Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity from Session  RSS feed

 
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();
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!