Hi friends, I am facing a problem in a hql query, which is describe as below:
Query cityQuery=session.createQuery(" from City where cityCode=:paramCityCode "); City city=(City )cityQuery.setString("paramCityCode", cityCode1).uniqueResult();
corresponding sql query generated by hibernate is :
select city0_.city_name as cit1_26_, city0_.city_code as cit2_26_ from city city0_ where (cityCode=? ) which is causing error on database-server, which is obvious bcoz there should be city_code instead of cityCode.
but it should generate like this: select city0_.city_name as cit1_26_, city0_.city_code as cit2_26_ from city city0_ where city_code=? .
I have done proper hbm. mapping too, if not then city0_.city_code should not come.
I am unable to track the cause. I am using hibernate3.0. Please let me know if i am doing something wrong somewhere, or I need to do some other configuration.
Thanks in advance
|