As of 4.2.15 and 4.3.6, only the equal operator is supported to compare composite types. When they are used, other operators generate incorrect SQL. See HHH-5946 for not equality.
This issue is for supporting inequality operators (<, >, <= and >=) as well. Since inequality comparison isn't required by JPA, I guess this is a new feature rather than a bug.
I've already modified the org.hibernate.hql.internal.ast.tree.BinaryLogicOperatorNode class in order to translate:
(a0, a1, a2) <= (b0, b1, b2)
into:
a0 < b0 or (a0 = b0 and a1 < b1) or (a0 = b0 and a1 = b1 and a2 <= b2)
I'm now facing an issue with parameter assignment. If, say, b is a parameter, then b0 and b1 need to be assigned several times. I currently have no idea about how to do this. Any help on this would be greatly appreciated. When tested, my current code throws an exception telling that parameter #x has not been assigned.
All this being said, do you think this is a feature worthy to work on?
|