You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Guglielmo Carandente <g....@cnmedia.it> on 2008/10/10 12:34:53 UTC
There is a bug in getMostCommentedWeblogs method
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&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 < ?1 AND
c.weblogEntry.pubTime > ?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
R: There is a bug in getMostCommentedWeblogs method
Posted by Guglielmo Carandente <g....@cnmedia.it>.
My solution don't work somebody can help me to modify this query, to add a
order condition?
Do getMostCommentedWeblogs works fine in our blogs??
-----Messaggio originale-----
Da: Guglielmo Carandente [mailto:g.carandente@cnmedia.it]
Inviato: venerd� 10 ottobre 2008 12.35
A: user@roller.apache.org
Oggetto: There is a bug in getMostCommentedWeblogs method
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&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 < ?1 AND
c.weblogEntry.pubTime > ?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