Hi guys,
I recently started to use hibernate and hql and have one question. Hql magically rearranges brackets considering operator priority. It seems it is not always correct. For example, i have such query
Code:
session.createQuery(
"from Node as node " +
",ImportedContentNode as icn " +
"where node.nid=icn.nid and " +
"icn.unifiedTitle like (? + '%')")
.setString(0, unifiedTitle)
.list();
In mysql console syntax
Code:
... like (? + '%')
is correct and without brackets is incorrect. But hql omits brackets, so resulting query looks like
Code:
... where node0_.nid=importedco1_.nid and (importedco1_.unified_title like ?+'%')
Do you have any suggestions or workarounds for such case?
TIA