Query using 2 classes

Hi!

Thanks for attention.

The first thing I didn’t see in both your queries was the connection between the tables

This is not necessary (although it is wrong for large tables - we will get cross join), we can do the terms in WHERE clause.
Here is an example from documentation:

select
  att.filename
from
  XWikiAttachment att,
  XWikiDocument doc
where
  doc.fullName='Main.WebHome'
  and att.docId=doc.id

And I got it! You’re using a join between two objects that are on the same document.

It’s a different documents.

And if you remove the restriction and hdw.hdwID > 1 and see what values the property hdw.hdwID takes in the select statement.

Unfortunately, it doesn’t work too.

XWQL and HQL in XWiki are slightly more unusual than classic SQL.