This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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: 30586
    
154

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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
 
GeeCON Prague 2014
 
subject: BMP and DAO - what comes first