massep wrote:
I'm a newbie myself but, did you try using the ClassicQueryTranslatorFactory
instead of the ast.ASTQueryTranslatorFactory?
If not you might want to try it. In my environment I changed it in hibernate.cfg by adding the following entry:
<hibernate-configuration>
<session-factory>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
</session-factory>
</hibernate-configuration>
Good luck.
Thanks massep, it helped but gives me another error ..... which says
Exception in thread "main" org.hibernate.QueryException: in expected: map [select map.object_type, map.function_name from authorization_mappings map join authorizations auth USING(permission_id) where auth.person_id=4706]
What I am curious to know is, whether writing such SQL queries within HQL is a good propramming practice from Hibernate point of view ????
All I wanna do is a JOIN On two views which look like this:
Authorizations View:
=================
auth_id | permission_id | person_id
____________________________
1 | 4 | 4706
2 | 7 | 4706
3 | 9 | 4706
AUthorizations Mapping View:
========================
permission_id | object_type | fucntion_name |
______________________________________
4 | employee | read
7 | customer | write
9 | employee | read
The Join should fetch me out the "object_type" and "function_name" columns for all person_id = 4706
SO my question is what is the best way to implement such a JOIN????