Pe4enko created Bug HHH-8047
Issue Type: Bug Bug
Affects Versions: 4.2.0.CR2, 3.5.6
Assignee: Unassigned
Components: query-criteria
Created: 04/Mar/13 7:38 AM
Description:

I have ORACLE DB and 2 tables.
I need select rows from table1 inner join table2 and order by ORACLE RowID column.
To select I use criteria query.
To add order by statement I use

criteria.addOrder(Order.asc("this.rowId"));

In mapping RowId look like

<property name="rowId" column="ROWID" insert="false" update="false"/>

But hibernate generate wrong sql query like

select this_.docId as attr0_, this_.name as attr1_ from table1 this_ inner join table2 t2_ on this_.docId=t2_.docId order by ROWID asc

Hibernate drop alias "this" from query. Because all tables in ORACLE has ROWID column, we have oracle error ORA-00918

Hibernate drops alias because in org.hibernate.dialect.Oracle8iDialect "rowid" register as Function but "rowId" it's not a function. It a column and in query it must have table alias "order by this_.ROWID"

Environment: ORACLE 10
Project: Hibernate ORM
Labels: criteria query rowid
Priority: Critical Critical
Reporter: Pe4enko
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira