@org.hibernate.annotations.RowId annotation and native queries

Using @RowId and native queries to fetch entities, we get ORA-17006. Any solution?

If you plan to use @RowId with ORACLE DB and JPA/Hibernate stack,
you should know that the default alias basis for the ROWID column is "rowid_"
and that Hibernate use a numbering strategy starting from 0.
Resulting into the correct query pattern for fetching entities with a native query being:
SELECT t.*, t.ROWID as rowid_0_ FROM table_backing_the_entity t