[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3420) MatchMode doesn't escape wildcard characters

Sam (JIRA) noreply at atlassian.com
Mon May 25 09:56:13 EDT 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sam updated HHH-3420:
---------------------

    Attachment: OracleMatchModeTest.java

Existing mapping file "criteria/Enrolment.hbm.xml" is used for this test.

> MatchMode doesn't escape wildcard characters
> --------------------------------------------
>
>                 Key: HHH-3420
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3420
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-criteria
>    Affects Versions: 3.2.2
>         Environment: MySQL
>            Reporter: Hontvári József
>            Priority: Minor
>         Attachments: OracleMatchModeTest.java
>
>
> One can think that by specifying e.g. MatchMode.START in a "like" restriction Hibernate takes care of escaping SQL LIKE wildcard characters in the supplied pattern. It doesn't, actually Hibernate only inserts a % before the first character.
> I am not sure what was the intent of the original author (Gavin King), so the issue may only be missing documentation. However I don't see any other useful purpose of this class then providing database independent escaping. It seems that all databases use the % wildcard, so there is no need to provide database indpeendence to that.
> It can be argued that this might create a security problem for an unaware developer, so I set issue type to bug.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the hibernate-issues mailing list