Jean Couteau wrote:
I would have a look to this sql request.
#set ($sql = ", BaseObject as obj where obj.name=doc.fullName and
obj.className='${doc.space}.${class}Class' and
obj.name<>'${doc.space}.${class}ClassTemplate' and obj.space='Space
1')
I am not sure as i do not have the same configuration, but i think it
should be quite close, or maybe with obj.spaceName='Space 1'
To better understand these queries, you should look at the hibernate
mapping files and the HQL documentation.
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/…
http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html
We're lacking documentation on this, and queries using HQL are pretty
much developer oriented. We're working on alternative querying models
which are already available, but not ready for general use yet.
I am quite interested in your results cause i might
implement something
similar in the future.
Hope this helps.
Kevin_C a écrit :
OK, that makes sense.. In fact I think I saw
something similar in the ToDo
tutorial, I should have remembered that. Do you know how I would go about
querying for the 5 most recently created documents of a given type within a
space?
What I'm trying to accomplish is something like:
FAQs
Space 1
* Doc 1
* Doc 2
* Doc 3
* Doc 4
* Doc 5
Space 2
* Doc 1
* Doc 2
* Doc 3
* Doc 4
* Doc 5
and so on...
I know you can query for docs of a specific type but what about narrowing
the search to a space?
Thanks!
.:. Kevin
--
Sergiu Dumitriu
http://purl.org/net/sergiu/