Hi, I have the following model:
Code:
class A{
Map<String, Integer> tags
}
class B{
A a;
}
I need to find instances of
B where its associated
A has a certain key value in its
tags map
I issue the following HQL Query
Code:
FROM B WHERE index(a.tags) = 'the_value'
Unfortunately, this yields to a SQLGrammarException.
The query being built has a WHERE clause that ends with:
Quote:
and tags2_.tags_idx='the_value'
and the exception message is Column not found: TAGS2_.TAGS_IDX
Unfortunately, the alias
tags2_ is not previously declated in the statement, which leads to the exception.
Any ideas?
Regards