• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA and DAO

 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
srivastava ashish
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using DAO will be help even in JPA specially in case of multiple DataSources.
 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

Regards,
Kumar
 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic