0
<query name="getStudyTasksByParticipantId">
            from StudyTask st 
            join (select max(lastUpdatedDate)as lastUpdatedDate, study, clinicalStudyRegistration from
                     StudyTask where clinicalStudyRegistration.participant.id in (:participantIds) 
                     group by study, clinicalStudyRegistration ) lst 
            where st.lastUpdatedDate = lst.lastUpdatedDate 
            order by st.lastUpdatedDate desc

        </query>

当我运行此查询时,它会给出类似unexpected token: ( at line 3 col 30.

这个查询有什么问题

4

1 回答 1

1

查询不是有效的 HQL。文档说:

请注意,HQL 子查询只能出现在 select 或 where 子句中。

连接只能通过两个实体之间的关联来完成。

于 2012-06-27T07:43:16.417 回答