I asked an earlier question about GORM: How to get entries in a graph by maximum date and group at the same time. However, someone suggested that this be easily achieved using HQL. But using HQL, I get an error unexpected token. When I examined this, I found out that HQL does not allow INNER JOINSif there is no connection between two objects: HQL, left join in the same table
So, I'm lost. Firstly, I'm upset why such a simple query is not supported by GORM, and now with HQL my question is: how do I execute an INNER JOIN on a subset?
What I tried:
unexpected token: (near row 1, column 16 [select c from (select name, max (dateCreated) as maxTime from com.mine.Color group by name) as t internal connection Color c by c.name = t.name and c .dateCreated = t.maxTime]
I suspected that the second instance was Colornot detected, since the package name did not automatically receive a prefix to it. Therefore, while reading the other answers I tried:
unexpected token: (near row 1, column 16 [select c from (select name, max (dateCreated) as maxTime from com.mine.Color group by name) as t, com.mine.Color as c on c.name = t .name and c.dateCreated = t.maxTime]
birdy source
share