I tried to execute two hqls as the following in the same session:
Select p from TblProduct p where p.id.TblTitle.TitleId=:id and p.id.ProductId=:pid
update TblProduct set TblCubeLayout=:layout where id.TblTitle.TitleId=:id and id.ProductId=:pid
I got the the hql execute exception. The output parsed hql is as the following:
'select tblproduct0_.TitleId as TitleId0_, tblproduct0_.ProductId as ProductId0_, ... , from dbo.tblProduct tblproduct0_ where tblproduct0_.TitleId=? and tblproduct0_.ProductId=?'
'update dbo.tblProduct set StockLocationId=? where
tblproduct0_.TitleId=? and
tblproduct0_.ProductId=?'
I am very confused. As you can see, I didn't define an alias name in the update hql because there is a alias name problem in update hql which I posted in
http://forum.hibernate.org/viewtopic.php?t=948837. However, it looks the hibernate keep the alias name from the first hql. I met this kind of problem sever times.
Anybody can help? Thanks