aspose file tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JPA and DAO Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Reply Bookmark "JPA and DAO" Watch "JPA and DAO" New topic
Author

JPA and DAO

vikram kumar
Ranch Hand

Joined: Aug 01, 2005
Posts: 58

Hi,

While using JPA, do we still need to use DAO class to connect DB or we can very well connect to database stright away from JPA class itself.

Regards,
kumar
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

You'll still want to go through a DAO. The DAO pattern is still valid, although there is some debate about that.

Here's a little tutorial on DAOs and Hibernate/JPA that you might find interesting:

Hibernate JPA Entities and the DAO Design Pattern

Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
guru prasanth
Ranch Hand

Joined: Aug 20, 2009
Posts: 82
In your application if you want to use different datasources then dao is an option.Otherwise if your application has to access data from just one database then Dao would't make much sense.
Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 230
guru prasanth wrote:In your application if you want to use different datasources then dao is an option.Otherwise if your application has to access data from just one database then Dao would't make much sense.


Dao is good way in isolate DB/LDAP (even with JPA). Application/service layer does not need to know what's "back there".


SCJP 5.0, SCJD URLyBird 1.3.3, OCMJEA 5 (SCEA) Factory Homes
srivastava ashish
Greenhorn

Joined: Apr 12, 2010
Posts: 28
Using DAO will be help even in JPA specially in case of multiple DataSources.
vikram kumar
Ranch Hand

Joined: Aug 01, 2005
Posts: 58

Thanks All , I plan to have DAO Layer in my JPA implementation.

Regards,
Kumar
vikram kumar
Ranch Hand

Joined: Aug 01, 2005
Posts: 58

Should we need to have JSF Backed Bean in the Class Diagram and Sequence Diagram, I thought of not to mention it, as its part of the framework. Kindly please through some light on this.

Regards,
Kumar
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JPA and DAO
 
Similar Threads
why DAO?
Need your opinions on this !
Dao Layer design
DAO connection
DAO and Entity class