This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes BMP and DAO - what comes first Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "BMP and DAO - what comes first" Watch "BMP and DAO - what comes first" New topic
Author

BMP and DAO - what comes first

Saha Kumar
Ranch Hand

Joined: Feb 23, 2006
Posts: 218
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

Joined: May 26, 2003
Posts: 32481
    
214

They get used internally by the entity bean. The client still causes the BMP.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Saha Kumar
Ranch Hand

Joined: Feb 23, 2006
Posts: 218
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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: BMP and DAO - what comes first
 
It's not a secret anymore!