Uploaded image for project: 'JCommune'
  1. JCommune
  2. JC-246

Replace manual statistics count with a hibenate calculable attributes

VotersWatchers
    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.9
    • Labels:
      None
    • Environment:

      Default

      Description

      Service and dao methods like getSomethingInSomethingCount() should be removed. Instead model properties with Hivernate "formula" attribute should be used. If, for instance, we need to get a post count for a user we should define User.postCount field and map it as formula with appropriate SQL\HQL query. When we need to render this statistic info we're just calling User.getPostCount() without referring any dao or service objects.

      Some count-like queries represents glodal statistics unrelated to any particular entities, like total message/topic conunt for the whole forum. Thesequeries are out of scope of this improvement.

      To learn more about Hibernate formulas please refer to http://tim.oreilly.com/pub/a/onjava/2005/08/03/hibernate.html?page=1

        Attachments

          Structure

            Activity

              People

              • Assignee:
                elishtar Andrey Kluev
                Reporter:
                jk1 Evgeniy Naumenko
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5h Original Estimate - 5h
                  5h
                  Remaining:
                  Time Spent - 7h Remaining Estimate - 5h
                  5h
                  Logged:
                  Time Spent - 7h Remaining Estimate - 5h
                  7h

                    Structure Helper Panel