According to documentation I have to use createQuery(String, Class), createSelectionQuery(), or createMutationQuery() instead of deprecated createQuery(String). But all of them doesn't fit.
Would you tell me what exactly method shoul I use for this query? Thank you in advance.
I haven't found this information on internet.
UPD: Should I use Criteria API in this case?