문제

Following HQL:

"-(a.import + a.bill)"

gets translated to following SQL:

"-a.import + a.bill"

instead of expected:

"-(a.import + a.bill)"

This makes the operation to calculate a result diferent from what is expected.

The translation has been proved with org.hibernate.dialect.Oracle10gDialect and with org.hibernate.dialect.HSQLDialect

Hibernate's version is 3.5.1-Final

Does anybody knows why is this happening? is this a bug?

도움이 되었습니까?

해결책

It happens because of bug HHH-6714. Solution is to update Hibernate to newer version. If you have to stick with 3.x, then 3.6.9 or newer. In 4.x any stable release goes, because it was fixed in 4.0.0.CR6.

I tried with 3.6.10 and parentheses remained.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top