Hi all,
I have general trouble with the syntax of HQL query when reffering "map" (key-value) collections. I've already read docs several times, looked at unit tests, searched forums (hibernate forum too) with no luck. At first, it looks very simple :
Code:
<class name="foo" >
..
<map name="bar">
<key column="id_foo" />
<index column="bar_key" />
<element column="bar_value" />
</map>
</class>
but I have no idea how to refer "key" and "value". I know about "indices" and "elements" but it is not what I need. They allow me to refer key -or- value , not both of them in the same time. I need for example to get objects which contain in their map keys > 10 and values < 100, something like:
Code:
select f from foo f where count( select b from f.bar b where b.KEY>10 and b.VALUE<100)>0
The problem is even bigger witch entity index or element (index-many-to-many, many-to-many).
Please help - the problem affects major part of my application, I have many maps and plenty of ugly loops when dealing with them.
--
michal