Announcement Announcement Module
Collapse
No announcement yet.
Load DAOImpl and its respective Queries on demand Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Load DAOImpl and its respective Queries on demand

    Hi,

    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.

    Thanks.

  • #2
    Hello

    where I need to load the SQL queries for the specific DAO on demand when the request has been made
    Would you explain explicitly your case with an example?

    Whether it is better to load the DAOImpl and specific SQL for those DAO on demand (lazy-init="true")?
    What do you mean with that? Do you know the MVC pattern?

    In advance, use annotations, there you can use named queries too, all in one place, so can avoid use XML

    If you can share more details I would help you. I dont understand well your exact situation

    Kind Regards

    Comment


    • #3
      Thanks. What is happening right now is we are having all our queries irrespective of the modules in a single XML file which is loaded during the startup as an eager loading. Similarly there are DAO's irrespective of the modules will be loaded during the startup as a eager loading in spring.

      Now my requirement is to make sure only the HQL queries specific to the DAO will be loaded and more importantly i am working in a module called Customer Management, hence I want to load only the DAO specific to that Customer Management like CustomerServiceImpl and CustomerDAOImpl. Where I dont want to load the other modules like Invoice Management which Customer Management doesnot have any dependency. By doing so, i will be loading the respective DAO's specific to my module on demand using lazy-init="true". Another thing is when I load my module specific DAO i want my HQL queries to be loaded as well rather than clubbing all the module specific HQL queries in a single XML and load it. I want to segregate and load only the HQL queries specific to my module when I load the DAOImpl for that module.

      I hope you got my point. Please clarify how we can proceed with this?

      Thanks.

      Comment


      • #4
        Originally posted by RithanyaLaxmi View Post
        Thanks. What is happening right now is we are having all our queries irrespective of the modules in a single XML file which is loaded during the startup as an eager loading. Similarly there are DAO's irrespective of the modules will be loaded during the startup as a eager loading in spring.

        Now my requirement is to make sure only the HQL queries specific to the DAO will be loaded and more importantly i am working in a module called Customer Management, hence I want to load only the DAO specific to that Customer Management like CustomerServiceImpl and CustomerDAOImpl. Where I dont want to load the other modules like Invoice Management which Customer Management doesnot have any dependency. By doing so, i will be loading the respective DAO's specific to my module on demand using lazy-init="true". Another thing is when I load my module specific DAO i want my HQL queries to be loaded as well rather than clubbing all the module specific HQL queries in a single XML and load it. I want to segregate and load only the HQL queries specific to my module when I load the DAOImpl for that module.

        I hope you got my point. Please clarify how we can proceed with this?

        Thanks.
        Guys any update will be really appreciated.

        Comment

        Working...
        X