开发者

"NOT IN" with HQL and Grails

The following query should select all organisations that are not in the excludedOrgs:

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

All I get is an org.springframework.orm.hibernate3.HibernateQueryEx开发者_StackOverflow社区ception telling me: expecting IDENT, found '?'

I'm using Grails 1.3.6.

What's wrong with my query?


both should work (as named and positional params are allowed)

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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜