I have the following property in my hibernate entity:
@ElementCollection(targetClass = String.class, fetch = FetchType.EAGER)
@CollectionTable(name="FORMDATA", joinColumns = @JoinColumn(name="FORM_ID"))
private Map<String, String> formData;
I want to do a query with hibernate Criteria where I want to match a form with a given key-value pair, something like this:
criteria.add(Restrictions.like("formdata.key", "%"+value+"%").ignoreCase());
where 'key' and 'value' are passed via method parameters.
Anyone knows how this should work? For me the hibernate documentation is not clear on this.
Thanks a lot, B.