Hibernate version: 3.2.3
How do I specify, in HQL, an update statement that will update a subset,
bound by some number n, of a matching set of records?
In SQL (and Oracle), I could do something like:
update EVENT_TABLE
set STATE = 'new value'
where rowid in
( select rowid from EVENT_TABLE where STATE = 'some value' and rownum <= 5);
This updates the first 5 rows that match the condition STATE = 'some value' even though there are many more records that actually match.
This uses Oracle's constructs of which rownum is used in Hibernate pagination, but not updates as far as I can see.
Can rowid be used by HQL or does it need to actually be mapped
to an unused property in the mapping file?
Is there a better way of doing this?
_________________ Cheers,
Bonny
please don't forget to rate :)
|