Uploaded image for project: 'Reporting Module'
  1. Reporting Module
  2. REPORT-473

Consolidate all Hibernate queries in a common utility method and enable logging

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Reporting 0.9.1
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      It would be helpful to evaluate all of our hibernate queries in a common service utility method, in order to be able to add logging and other value added features around this action.

      This should be a simple as adding a new method within HibernateCohortQueryDAO called "executeHibernateQuery(Query query)".

      This would take in a Query object (which could either be an HQL or a SQL query), would check a global property (eg. "reporting.enableLoggingForQueries") and if this is true, it would:

      • Get the statement out of the Query
      • Get the named parameters and their replacement values, and replace them in the query where appropriate
      • Log this statement to a log file (using a custom log4j Logger?)
      • Execute the query using the hibernate API and return the results
      • Log whether this statement was successful or failed, and if failed, what the exception message is

        Attachments

          Activity

            People

            Assignee:
            mseaton Mike Seaton
            Reporter:
            mseaton Mike Seaton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: