This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BMP and DAO - what comes first

 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

When using a DAO to persist an entity bean, do the DAO methods get called from a client, or does the DAO get used internally by the entity ejb?

Thanks in advance.

-Saha
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They get used internally by the entity bean. The client still causes the BMP.
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeanne,

Thanks for the reply. So are you saying that a client (say stateless session bean), could have the following code to create and update a Customer? Only the Customer entity bean knows about DAO? Which method in entity bean contains the code to insert a customer record? Which to update?

createCustomer (data) {
Customer customer = customerHome.create(data);
customer.setStatus("new");
}

Thanks much in advance.

-Saha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic