This content has been marked as final. Show 1 reply
I have faced the same problem. You have probably found the sollution youself.
Just for the protocol I'll add my sollution to this problem so that others could use it.
The query I formed was like
SELECT distinct object(o) FROM Rental o WHERE lower (o.description) LIKE lower('%:fullTextSearch%')
later in the code an attribute was set via (q is a an EJB3 Query object)
After playing with parameters and code I finally did the following changes that fixed the issue.
SELECT distinct object(o) FROM Rental o WHERE lower (o.description) LIKE lower(:fullTextSearch)
and the attribute setter like
q.setParameter("fullTextSearch", "%" + aSubStringToSearchFor + "%");
The problem is obviously that Hibernate is not capable of setting a parameter within single-quoted statements.