Announcement Announcement Module
Collapse
No announcement yet.
Does spring/hibernate support select rownum? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Does spring/hibernate support select rownum?

    I need to have the following query in my app,

    select * from

    (select rownum rown,a.* from table_part_num a)

    where rown between 5000 and 6000

    Does spring/hibernate support it?

    Thanks.

  • #2
    I think you could define a named sql-query in your mapping file using something like the following

    Code:
    select {b.*} 
     from
      (select rownum rown, a.* from table_part_num a) b
     where b.rown between :min and :max
    and then map "b" to some object.

    Comment

    Working...
    X