How do you check if a Map value exists?
In the basic simple map situation (String index,String value), I used:
Code:
from obj o where o.map['key.to.check'] is not null
This works.
Now I have an object with a composite element:
MappingCode:
<map name="variables" table="CUSTOMERVARIABLES" cascade="all" lazy="true" order-by="TIME_OF_CREATION" >
<key column="ID"/>
<index column="NAME" type="string"/>
<composite-element class="nl.dennie.vikie.model.CustomerVariable">
<property name="timeOfCreation" column="TIME_OF_CREATION" type="calendar"/>
<property name="value" column="VALUE" type="string"/>
</composite-element>
</map>
The same check gives the following exception:
ExceptionCode:
net.sf.hibernate.QueryException: path expression ended in composite collection element [from nl.dennie.vikie.model.Company c where c.variables['fetch.mail'] not is null]
Can somebody tell me how to do this? Or should I simply do an inner join on the map and check on it ?