使用HQL和Grails"不在"

dea*_*mon 3 java orm grails hibernate hql

以下查询应选择不在以下内容中的所有组织excludedOrgs:

Organisation.findAll("from Organisation o where o not in elements(?)", 
    [excludedOrgs])
Run Code Online (Sandbox Code Playgroud)

我得到的是一个org.springframework.orm.hibernate3.HibernateQueryException告诉我: expecting IDENT, found '?'

我正在使用Grails 1.3.6.

我的查询有什么问题?

lwe*_*ler 8

两者都应该工作(如命名和位置参数允许)

Organisation.findAll("from Organisation o where o not in (?)", [excludedOrgs])

Organisation.findAll("from Organisation o where o not in (:excludedOrgs)", ["excludedOrgs":excludedOrgs])
Run Code Online (Sandbox Code Playgroud)