这就是我试图实现的目标:
@NamedQuery(name = "Info.search", query = "SELECT info FROM INFO info
WHERE info.content LIKE ?1 OR info.content LIKE ?2 OR ?1 LIKE info.content OR ?2 LIKE info.content")
问题是JPQL抛出异常:You have attempted to set a value of type class java.lang.String for parameter 1 with expected type of class java.lang.Boolean from query string
这告诉我JPQL不允许我在where
语句中的操作符之前给出参数,如:where ?1 like someColumn
我如何解决这个问题并获得我需要的信息?
谢谢。