Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 125723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:12:15+00:00 2026-05-11T05:12:15+00:00

I have a complicated HQL query. I would like to access the Oracle specific

  • 0

I have a complicated HQL query.

I would like to access the Oracle specific rownum column value as part of my returned results. How do I write my query (and/or change my hbm.xml) to support this?

What I have tried so far does not work:

modifying my hbm.xml

<property name='rownum' type='int' update='false' insert='false' generated='never'/> 

and a query such as:

'select dog.rownum from Dog as dog where ...' 

But I get java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification

I suspect I might need to mix some sql with my complex hql query… suggestions welcome. Thanks.


Some background:

  • http://ronfrancis.wordpress.com/2007/10/16/dont-forget-an-order-by-for-pagination-queries/
  • hibernate uses oracle’s rownum ‘under the hood’ to paginate results.
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:12:16+00:00Added an answer on May 11, 2026 at 5:12 am

    ROWNUM doesn’t belong to any table, so your query should be:

    'select rownum from Dog as dog where ...' 

    For example:

    SQL> select emp.ename, rownum from emp;  ENAME          ROWNUM ---------- ---------- SMITH               1 ALLEN               2 WARD                3 JONES               4 MARTIN              5 BLAKE               6 CLARK               7 SCOTT               8 KING                9 TURNER             10 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have quite complicated query from which I would like to create a view.
I have a complicated controller with a XIB interface view. I would like to
I have a complicated page being rendered by PHP and would like to keep
I have this complicated SQL query for Oracle that I want to visualize in
I have a complicated query written on SQL Server 2000 which in part contains
I have a complicated MySQL query which takes a lot of time, selecting from
I have a complicated set of routes and I need to edit a specific
I have a complicated query built up based on a users profile, I start
I have a complicated MYSQL query question here. I try my best to explain
I have a complicated query I've been working on, and I recently changed one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.