开发者

Error in creating alias in formula tag

开发者 https://www.devze.com 2022-12-21 07:21 出处:网络
I have a sql query in formula tag inside property tag. In that query i am creating alias name but the hibernate appe开发者_如何学Pythonnds table name and throwing me error.

I have a sql query in formula tag inside property tag.

In that query i am creating alias name but the hibernate appe开发者_如何学Pythonnds table name and throwing me error.

select sum(e.salary) as sal from employee e

but hibernate changes to

select sum(e.salary) as employee.sal from employee e

how to avoid this ....

it should recognise as sal inside of employee.sal !!!


Why don't you just declare:

<property name="salary" type="integer"
formula="( select sum(e.salary) from employee e )">
</property>

What's the point of the alias?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号