Parameter « DAO « JPA Q&A

1. Have parameters in Dao methods to get entities the most efficient way for read-only access

Allot of my use of hibernate, at least for that data that is presented on many parts of the web application, is for read-only purposes. I want to add some parameters to ...

2. Hibernate DAO method parameters

Which one do you prefer and why?

  1. Reservation[] find(User user, Show show)
  2. Reservation[] find(long userId, long showId)

3. Named query & JPA: Undefined parameters while generating DAO

Newbie Joined: Mon Mar 01, 2010 7:17 am Posts: 10 Hi everyone, I am currently trying to generate methods on a DAO Home, for each named query that is defined on a JPA entity. Unfortunately, the NamedQueryDefinition object that I get from Configuration.getNamedQueries(queryName) does not have a valid parameterTypes Map. The return Map is null, causing the my template to fail. ...

4. passing parameters to Hibernate DAO

Hi All, I would like to know your opinion on this. I have Hibernate DAO classes. Each class has methods which will comprise of lot many input parameters. These parameters are nothing but arguments which will be used in Criteria object or HQL. My question is should we keep our methods verbose and have separate params. This way the method signature ...