We currently have some DAOs with MANY queries, all using private static final strings as the query text. We're trying to clean this up and make it easier to read, as well as more efficient. In doing so we've decided to use named queries. We are using hibernate 3.2 with annotations and Spring 2.0.2. It seems like our only option is to have a named query annotation at the top of the class. I guess I have two questions:
1. Is it possible to externalize these queries to another file other than an .hbm.xml as to not make the DAOs any bigger? (I should have mentioned that we have all of our classes mapped in the applicationContext.xml file)
2. Is there another way to externalize these queries to another file that we aren't thinking about?
Thanks in advance,
Mike
|