Menu

#33 Exception creating an ILIKE filter in SearchInfo using %%

1.2.*
closed-fixed
bugs (28)
5
2009-05-28
2009-05-08
No

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

Discussion

  • Roberto Lo Giacco

    • status: open --> pending
     
  • Roberto Lo Giacco

    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.

     
  • Roberto Lo Giacco

    • assigned_to: ggperrone --> rlogiacco
    • status: pending --> pending-fixed
     
  • SourceForge Robot

    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).

     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.