fetch « DAO « JPA Q&A





1. DAO and multiple fetching strategies    forum.hibernate.org

Hi, I'm trying to develop my application using Hibernate, but still defining DAO's in order to persist objects. I use a generic DAO with CRUD operations as "Don't Repeat the DAO" article and "Java Persistence with Hibernate" book suggests, plus a generic findAll() method. My first question is: is that a good approach? I'm loosing some Hibernate features, such as the ...

2. My Dao fetching a list not not being Cached    forum.hibernate.org

[Running Hibernate 3.3.1] When I fetch a list(Collection like getAll() method) of items from my DB within my DAO, I set the Query setCacheable(true).setCacheMode(CacheMode.GET). My class-cache has been setup in hibernate config xml file. A new select query is executed every time I try getting d list of Items, dis is as observed from the show sql log. But new select ...