I have Class A with fields
Long id
B activity
And related class B
Long id
String name
Then I have the HQL query:
select a.id, a.activity.name from A a;
Some B fields on class A have null values, so left join gives more results than inner join.
I'm generating automatically the HQL, so I want the select and then the count:
select count(*) from A;
This gives me different results.
Is some way to resolve this, other than adding the explicit left join on the SQL (I'm receiving the HQL, can't change it).