I have an HQL statement of this sort:
update versioned MyTable t
set t.myCol = case
when ((t.myCol + :myColChange) < 0) then 0
else (t.myCol + :myColChange) end
I see that this is not working due to the second occurrence of :myColChange
. The following exception is thrown:
org.hibernate.QueryException: Not all named parameters have been set: [myColChange] [ update versioned MyTable t set t.myCol = case when ((t.myCol + :myColChange) < 0) then 0 else (t.myCol + :myColChange) end]
Would appreciate any ideas to resolve this problem. Thanks!