ORACLE DB と 2 つのテーブルがあります。table1 内部結合 table2 から行を選択し、ORACLE RowID 列で並べ替える必要があります。選択するには、条件クエリを使用します。order by ステートメントを追加するには、使用します
criteria.addOrder(Order.asc("this.rowId"));
RowId のマッピングでは次のようになります
<property name="rowId" column="ROWID" insert="false" update="false"/>
しかし、休止状態は次のような間違ったSQLクエリを生成します
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 はクエリからエイリアス "this" をドロップします。ORACLE のすべてのテーブルには ROWID 列があるため、Oracle エラー ORA-00918 が発生します。
オラクルのRowId列で並べ替えるために、休止状態の基準で正しいクエリを作成するにはどうすればよいですか?