On Tue, Nov 4, 2008 at 7:48 PM, BrianJones <Brian.Jones(a)nrc-cnrc.gc.ca> wrote:
Thomas Mortagne wrote:
The prop contains all the tags of one document not just one tag.
I you want to get all tags ordered alphabetically, I think the
following should do the trick :
#set($sql = "select distinct elements(prop.list) as tagvalue from
BaseObject as obj,
DBStringListProperty as prop where obj.className='XWiki.TagClass' and
obj.id=prop.id.id and prop.id.name='tags' order by tagvalue asc")
Thanks for your reply Thomas, your suggestion seems to make sense to me, but
when I tested it out, I get an error in the Tomcat window, and the page
doesn't render. The error is as follows:
...
Cause by: org.apahace.velocity.exception.MethodInvocationException:
Invocation of method 'search' in class com.xpn.xwiki.api.XWiki threw
exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception
while searching documents with sql select distinct elements(prop.list) as
tagvalue from BaseObject as obj, DBStringListProperty as prop where
obj.className='XWiki.TagClass' and obj.id=prop.id.id and
prod.id.name='tags'
order by tagvalue asc
Wrapped Exception: could not execute query @ Main.Tags[5,22]
...
I guess there is a syntax issue somewhere, don't you have more
information in the log file ?
Any ideas? Thanks again
--
View this message in context:
http://n2.nabble.com/Help-with-%27order-by%27-clause-in-HQL-tp1455693p14561…
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne