How can I test a boolean parameter in a NamedQuery with JPA?

一个人想着一个人 提交于 2019-12-13 03:17: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.

来源:https://stackoverflow.com/questions/29033065/how-can-i-test-a-boolean-parameter-in-a-namedquery-with-jpa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!