开发者

Error in creating alias in formula tag

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜