Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: DAO

Aaron Tubman

2004-01-14


You can implement DAO as separated class and delegate requests for entity bean to DAO.

In additional you can use TO pattern. In this case your APIs are simplified to "create(TO)" , "update (TO)", "select (id)" returns TO, "delete(id)".

 

Aaron Tubman

 

-----Original Message-----
From: An interest list for Sun Java Center J2EE Pattern Catalog [mailto:J2EEPATTERNS-INTEREST@JAVA.SUN.COM] On Behalf Of Romulo M. Andrade
Sent: Wednesday, January 14, 2004 1:49 PM
To: J2EEPATTERNS-INTEREST@JAVA.SUN.COM
Subject: DAO

 


I have a basic doubt about DAO. I know that depends but I need to start.

My example is:

I have a table Customer.

How do I implement the DAO Patterns for the SQLs: insert, update and delete ?

Where do the SQLs stay ? Entity bean, class or Session Bean? Do I implement a session bean call a class with the procedures SQL?

The Pet Store doesn't have the insert methods. Is there a another good sample?

Thanks.

RĂ´mulo Andrade.

==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com

==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com
©2008 junlu.com - Jax Systems, LLC, U.S.A.