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:[EMAIL PROTECTED]
Inviato: venerdì 10 ottobre 2008 12.35
A: [email protected]
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&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: [EMAIL PROTECTED]

www.cnmedia.it







Reply via email to