Hi,
> whatever is more complex than simple POJO CRUD, I do it with proper SQL in
> stored procedures. I like
> JPA a bit more than other ORM, but I still see it lacking in this regard.
JPA is more akin to Model-View-Controller (MVC) programming model where
Model = database record/schema
View = POJO/domain objects
Controller = JPA API/Session Beans
Such MVC perspective does not lend itself well with the notion of operating
directly on the model (i.e. database records) with SQL and stored procedures.
The advantage of operating on the view rather than the model is, by now,
well-established especially from scalability and flexibility (e.g. against
pre-existing database schema) standpoint.
Of course, stored procedure or hand-written SQLs that expose/bind an
application to the database schema are required for certain class of
applications (especially where set-based computation is predominant pattern
than navigational access or short-lived transaction). But that class of
application perhaps not the main focus or suitable for JPA-based applications.
Regards --
Thanks for sharing this. In my case, I believe I still need DAO, see
(quoted from [1]:
"...The usage cannot be simpler. The EntityManager will be just injected
to the bean-class...The DAO pattern is actually no more interesting for
general data access, but is still needed to access data from stored
procedures, flat files etc..."
I don't do any **QL, whatever is more complex than simple POJO CRUD, I do
it with proper SQL in stored procedures. I like JPA a bit more than other ORM,
but I still see it lacking in this regard.
I just DON'T WANT to invoke a callable statement or named query in my
business code, that's why I need a DAO layer. This is what I want to do in my
business layer:
Collection<SalesReportLine> reportItems =
SalesReportLineDAO.query('2009-04-16');
I hope my motivation is clear, anyway I'll gladly hear any argument against
what I'm trying to do and proposes a better alternative.
Cheers,
Daniel
________________________________
De: Pinaki Poddar (via Nabble) <[email protected]>
Para: Daniel Toffetti <[email protected]>
Enviado: jueves 16 de abril de 2009, 1:51:16
Asunto: Re: Looking for advice on JPA based DAO
Hi,
Or may be with JPA, DAO is no more a useful pattern?
I tend to align with Adam Bien's view [2] in this ongoing debate [1].
[1] http://www.infoq.com/news/2007/09/jpa-dao
[2] http://www.adam-bien.com/roller/abien/entry/jpa_ejb3_killed_the_dao
Daniel Toffetti wrote:
Hi all,
I'm looking for a JPA based DAO solution with minimal dependencies on other
libraries. So far I've found lots of implementations based on JPA "and" Spring,
Hibernate, both of them, TopLink, etc.
I would like to know if there is any standard way of doing it, or reference
implementation (even small, unfinished open source), or else if it's worth to
attempt to do it.
Having seen so many DAO libraries and wrappers, so many articles and blog
posts everywhere, I must admit that I'm confused. Any advice is welcomed !!
Regards,
Daniel
Pinaki Poddar http://ppoddar.blogspot.com/
http://www.linkedin.com/in/pinakipoddar
OpenJPA PMC Member/Committer
JPA Expert Group Member
________________________________
This email is a reply to your post @
http://n2.nabble.com/Looking-for-advice-on-JPA-based-DAO-tp2641707p2641942.html
You can reply by email or by visting the link above.
Yahoo! Cocina
Recetas prácticas y comida saludable
http://ar.mujer.yahoo.com/cocina/
-----
Pinaki Poddar http://ppoddar.blogspot.com/
http://www.linkedin.com/in/pinakipoddar
OpenJPA PMC Member/Committer
JPA Expert Group Member
--
View this message in context:
http://n2.nabble.com/Looking-for-advice-on-JPA-based-DAO-tp2641707p2642836.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.