When hibernate parses out this hql:
Code:
UPDATE VERSIONED Person SET groupsCount = followingGroup.size WHERE id = :id
it generates this sql:
Code:
UPDATE Person
SET version =version+1,
groupsCount=
(SELECT COUNT(followingg1_.followerId)
FROM GroupFollower followingg1_
WHERE Person.id=followingg1_.followerId
)-1
WHERE id IN
(SELECT groupfollo2_.followerId
FROM GroupFollower groupfollo2_
WHERE groupfollo2_.followingId=?
)
That query fails at the "-1" after the subquery for the count of the followingids. If i take out the "-1" it runs just fine, or if i move the "-1" to "SELECT COUNT(followingg1_.followerId) - 1" it also works.
If this is indeed a bug, is there some way to override this behavior with some custom methods in a custom oracle dialect? Or other ways to get around this?