I tried to use the feature of searchinfo with ILIKE with % but hibernate generates an exception.
Suppose i have an object that has a property display which value is "hello".
I want to find this object using an ILKE search with the filter "%ello". This should return my object with display hello.
In order to do this i used the method super.getSearchInfo(request) ( in an Action that extends AbstractArchiveAction) to get the SearchInfo object using the request parameters.
Then i lanched the list method of my factory passing the searchinfo object. But an exception in generated:
javax.servlet.ServletException: org.hibernate.QueryException: could not resolve property: display%
The problem is that if you add the following filter "display%%ello" to a SearchInfo, it adds a filter ILIKE for "display%" with value "ello" instead of adding a filter ILIKE for "display" with value "%ello"
If i use the "%" in other position in the search work:
Example: "h%llo" works
Hello Cristian,
first of all thank you for your bug report, but I've to highlight something wrong in your statement: if you use a filter "display%%ello" what you should expect is an ILIKE filter on the display property for the string ello as the double percentage sign (%%) is used to mark the ILIKE operator. If you want to have a display ILIKE '%hello' you should add a filter like "display%%%ello"
Anyway your report has revealed a bug in the filter string parsing which has been fixed within rev. 1736 which includes a better test case.
I'm going to release a new 1.2.9-SNAPSHOT release on the snapshots repo (http://smartweb.sourceforge.net/snapshots), please let us know if it solves your problems.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).