Re: [xwiki-users] XWQL and ratings

2012-06-25 Thread Jeremie BOUSQUET
Could be solved if the following issue was solved: https://hibernate.onjira.com/browse/HHH-16 (Explicit joins on unrelated classes) But this issue has been there for a very long time ... And even with that it would consider that non-matching items (objects without average votes) would return null

Re: [xwiki-users] XWQL and ratings

2012-06-25 Thread Eduard Moraru
As far as I can tell, you can only do joins in HQL *if* you have set up object mappings (one-to-one, one-to-many, etc.). However, as far as I can see in our Hibernate mapping, XWiki does not do these mappings and only does basic property-to-primitiveType-to-table-column mappings. This is also the

Re: [xwiki-users] XWQL and ratings

2012-06-23 Thread ludo...@xwiki.com
I had the exact same objective a long time ago and could not find a solution. I think we thought about creating the missing objects. I don't think coalesce would have worked. The main issue is get the lines Ludovic Envoyé de mon iPad Le 23 juin 2012 à 21:50, Jeremie BOUSQUET a écrit : > Hi

Re: [xwiki-users] XWQL and ratings

2012-06-23 Thread Jeremie BOUSQUET
Hi Eduard, Well, that's what I expected but I did not succeed to find a solution with a unique query, wether in XWQL or HQL. The solution would be to do a left join, but I could not find how to formulate it and I wonder if it's possible with the current mappings. Jeremie 2012/6/23 Eduard Moraru

Re: [xwiki-users] XWQL and ratings

2012-06-23 Thread Eduard Moraru
Hi Jeremie, If you ultimately resorted to HQL, I guess you could of used HQL all the way instead of XWQL and have only 1 query instead of XWQL+HQL, right? Thanks, Eduard On Fri, Jun 22, 2012 at 2:51 PM, Jeremie BOUSQUET < jeremie.bousq...@gmail.com> wrote: > Hi, > > For the record, the only way

Re: [xwiki-users] XWQL and ratings

2012-06-22 Thread Jeremie BOUSQUET
Hi, For the record, the only way I found to achieve my need was to execute 2 requests. (the idea was to get list of pages ordered by ratings, then date). First XWQL selects rated pages ordered by ratings then date: #set($xwql = "select doc.fullName, ratings.averagevote from Document doc, doc.obje

[xwiki-users] XWQL and ratings

2012-04-27 Thread jerem
Hello community, I'm stuck on a problem to query average ratings data from pages - I installed the Ratings plugin, of course. The following query works as expected, and shows the pages having average votes, ordered by ratings then date : #set($xwql = "select doc.fullName, ratings.averagevote fro