How can I test a boolean parameter in a NamedQuery

2019-09-04 05:54发布

问题:

How can I tell JPA (EclipseLink 2.4) to check a boolean IN parameter whether it is true or false?

SELECT e FROM MyEntity e WHERE :inParam = TRUE AND e.x = 'bla'

or

SELECT e FROM MyEntity e WHERE :inParam = true AND e.x = 'bla'

Doing it as above results in an exception that TRUE wouldn't be a valid value for inParam.