Hi alls
Hibernate version: 2.1.6 and the latest from CVS
Name and version of the database you are using: Postgres 7.3.4 under Windows XP
I've got such hql query
Code:
select prop.value, report.status.code, count(*) from Report as report, CompanyProperty as prop
where report.deleted = 'FALSE' and report.organization.id in
(:myOrgKeys) and prop.refId = report.organization.id and prop.language.id=1 and prop.name = 'name' group by prop.value,
* report.status.code, prop.value order by LOWER(prop.value)
When i execute this query :
Code:
final Query q = session.getSession().getNamedQuery(Report.GET_STATISTIC_FOR_ORGANIZATION_SET);
/**
* orgIds is ArrayList with one java.lang.Long = 47
*/
q.setParameter("myOrgKeys", orgIds);
data = q.list();
Hibernate generate such sql code:
Code:
select companypro1_.value as x0_0_, reportstat2_.code as x1_0_, count(*) as x2_0_ from report report0_,
multilanguage_property companypro1_, report_status reportstat2_ where companypro1_.disc='comp' and
report0_.status_id=reportstat2_.status_id and ((report0_.deleted='FALSE' )and(report0_.org_id in(?))and
(companypro1_.ref_id=report0_.org_id )and(companypro1_.lang_id=1 )and(companypro1_.name='name' ))
group by companypro1_.value , reportstat2_.code , companypro1_.value order by LOWER(companypro1_.value)
And i've got empty list but if i execute sql query i've got 2 rows
Result : "2 rows fetched (0,19 sec)"
So i think there's a bug in hibernate that it doesn't return data which present in database or am i wrong ?
thank's[/code]