BrianJones wrote:
I have one other question to ask regarding this HQL query. Many of the
tags I'm using have a common prefix (for example one group of tags may
have the prefix 'xyz-', and another group may have the prefix 'zyx-').
How would I go about appending another WHERE clause in the HQL query to
only select the tags with the prefix 'xyz-'?
I found a topic in the archives that was similar to my problem, and it
suggested using the following query:
select distinct elements(prop.list) from BaseObject as obj,
DBStringListProperty as prop where obj.className='XWiki.TagClass' and
obj.id=prop.id.id and prop.id.name='tags' and obj.name in (select obj1.name
from BaseObject as obj1, DBStringListProperty as prop1 join prop1.list list
where obj1.id=prop1.id.id and prop1.id.name='tags' and list like 'xyz-%')
order by 1 asc
Although this query seems to be valid, the page renders, and there are no
errors in the Tomcat menu, it doesn't provide the functionality I'm looking
for. The list returned is definatly a slimmed down list from the 'All tags'
list, but it does NOT limit the list to only those tags with the 'xyz-'
prefix.
Any suggestions?
--
View this message in context:
http://n2.nabble.com/Help-with-%27order-by%27-clause-in-HQL-tp1455693p14609…
Sent from the XWiki- Users mailing list archive at
Nabble.com.