This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin 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();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!