This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JPA and DAO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
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: 4968
    
    1

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
guru prasanth
Ranch Hand

Joined: Aug 20, 2009
Posts: 96
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://aspose.com/file-tools
 
subject: JPA and DAO
 
Similar Threads
DAO connection
Dao Layer design
Need your opinions on this !
why DAO?
DAO and Entity class