I have a requirement, where I need to load the SQL queries for the specific DAO on demand when the request has been made. This will ensure that I am not loading all the objects as I will be loading only the objects which I am going to work with. That is the main idea behind this operation. I am using Hibernate for back-end which connects to Oracle DB. Whether it will be better to load all the module specific DAO's on-demand using lazy-init="true" in Spring and load the specific SQL queries for those DAO's? In hibernate we are using named queries. Hence, please do suggest me how we can go about this?
Whether it is better to load the DAOImpl and specific SQL for those DAO on demand (lazy-init="true")? If that is the case how we can do it? Please give me some examples on this? Whether we need to configure the named SQL queries in text file or XML? Which one will be better.Also suggest me which will be the best way of handling this? I am using Spring 2.5 and Hibernate 3.0. Any ideas are really appreciated.