LIKE checks with component values

Description

In the same way than a previous "issue" i.e. http://opensource.atlassian.com/projects/hibernate/browse/HHH-2826
it would be very helpful if the HQL translator would "explode" a LIKE instruction on each property of a component, rather than just using the equal "=".

Let's say a Person with a name property (component type "Name") and the corresponding HQL query:
... from Person p where p.name like ('Jo%n', 'Schm%')
This uses the "row value constructor" as described here: http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html#queryhql-tuple

Currently, the resulting SQL is something like:
... from Person p where p.f_name = 'Jo%n' and p.l_name = 'Schm%'
which is wrong as we've lost the purpose of the wildcard '%'

=> In this case, it just won't return the good results, but when the properties (here f_name, l_name) are something other than a String/VARCHAR (e.g. an INTEGER) it sometimes throws an error (like: % is not a number) ..!

The expected translation would be something like:
... from Person p where p.f_name LIKE 'Jo%n' and p.l_name LIKE 'Schm%'

I personally faced this case as I have an enumeration (enum, Java5) representing a set of business values, each mapped to a single sql column; as I don't want to list the name of ALL component properties (they are numerous, and easily iterable - thanks to the enum) and the "row value constructor" syntax is much easier to use in this case.

Environment

Hibernate 3.2.5
Oracle 10i

Assignee

Unassigned

Reporter

maxxyme

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major