Hi all,
I have been involved in design & development of a very large educational ERP. Currently i have updated my hibernate version from
3.0 to 3.3. I faced some issues which i am listing out below.
1. I used to write queries like
Code:
"from Company as company where company.status=:status and company.city=:cityId"
I got error while executing this query, & from forums i have found that i have to provide
"company.city.id" instead of "company.city". The query worked find when i changed accordingly. But the problem i have is, i have 100s of such queries. My question is,
should i have to change all those queries or is there any options /settings which allow me to use my existing queries?2. While fetching an embedded object (mapped using many-to-one association) if i query an object whose child object is null, i am getting an empty result. The query is like this,
Code:
"select company.id, company.name, company.city from Company as company where company.status=:status
in my case, "city" field might be empty for some Company objects. The same query worked fine with the previous version & if the object (Company) has a city, i am getting the result. Also if i remove "company.city" field from my select query, it returns result .
I have tried many options like fetch="join", not-found="ignore", etc.
Is there any way to select even this null child record?
Thanks in advance for your comments on this.