views:

187

answers:

1

I read this article:

http://www.ibm.com/developerworks/java/library/j-genericdao.html

several times and believe I understand what it is saying. However, it is 4 years old and I have a JPA compliant Java application to contend with. In addition, I see that there is a JPATemplate in Spring that has some good functionality, but the Spring documentation says it is already deprecated!

Can anybody point me to a solid, modern, JPA compliant, Spring based, working example of a GenericDAOImpl that proxies an Interface to provide generic finder execution?

+1  A: 

I've created a generic DAO mixing different approaches that I shared on SO in this question. I use these 2 approaches: DDD: The Generic Repository and JPA implementation patterns: Data Access Objects.

Please feel free to comment/edit if you think it can be improved.

rochb
Its a start -- thanks for the help. For me, an important aspect of it is the ability for a single DAO implementation to execute any named query via a set of DAO interfaces. The IBM article uses AOP, but I am working on an approach that uses a proxy object to implement the defined interfaces without AOP.
HDave