Hi all
I'm working on a project involving an Oracle 7.3 database, and I'm using Hibernate. I know that using this database is not optimal by any means, but there's nothing i can do about it, and it seams to work very well.
The problem is when i try to use queries that are sorted, like "from Object o order by o.property"), and then put a limit on the results returned by the query. Hibernate generates a SQL query with a subselect, using the rownum function like this:
Code:
select * from (select t.property p from table t order by p asc) where rownum <= ?
Oracle then complains about a missing right parenthesis, though the generated SQL looks fine to me. I've tried to put the "order by" cause after the "where rownum" cause, like this:
Code:
select * from (select t.property p from table t) where rownum <= ? order by p asc
And it works fine. Is there any way I can use the
Code:
hibernate.query.substitutions
to modify the way Hibernate generates the SQL query? Session conf is MBean on Jboss 3.2, Hibernate version 2.1.1.
Help much appriciated!
milx