roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guglielmo Carandente" <g.carande...@cnmedia.it>
Subject There is a bug in getMostCommentedWeblogs method
Date Fri, 10 Oct 2008 10:34:53 GMT
In the method getMostCommentedWeblogs there is a bug because query retrieve
result with limit but don't order they first.

I think the solution is this.in WeblogEntryComment.orm.xml file

 

<named-query
name="WeblogEntryComment.getMostCommentedWebsiteByEndDate&amp;StartDate">

            <!--

            DISTINCT is not required for this query - comments would never
be duplicated in retrieved result

            because all the navigations from c are for ManyToOne
relationship.

            -->

            <query>SELECT COUNT(c), c.weblogEntry.website.id,
c.weblogEntry.website.handle, c.weblogEntry.website.name FROM
WeblogEntryComment c WHERE c.weblogEntry.pubTime &lt; ?1 AND
c.weblogEntry.pubTime &gt; ?2 GROUP BY c.weblogEntry.website.id,
c.weblogEntry.website.handle, c.weblogEntry.website.name order by COUNT(c)
desc 

            </query>

        </named-query>

 

Do you think it's right?

 

Guglielmo Carandente
Junior Software Developer
cell: 3383567746

mail: g.carandente@cnmedia.it

www.cnmedia.it



 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message