imranjamadar wrote:
this is how i ported it to hql
select distinct os.ObjectId , sa.UseCount
from StudAct as sa
right outer join sa.ObjSet as os where sa.Student=12249
but this is giving me different results than the sql query. sql query is taking a cartesian product and somehow hibernate is not doing it.
please help me.
Your SQL Statement isn't joining on any columns which is why you're getting the cartesian product. The HQL is joining on the key column.
You HQL is doing a join on the key column, then filtering on student 12249.
Are you sure the SQL is what you really want ? Can you show your table definitions ?