• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JPA and DAO

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic