0

I want to fetch the rowID of a table that does not have a primary key. I could get the rowId using sql query.But i think RowID is database specific.So it is not going to work if the database changes.

Could someone help me to get the rowID either using hql or criteria ?

Udhay
  • 189
  • 1
  • 1
  • 6

1 Answers1

0

ROWID is virtual column like any other. Try to search for VIRTUAL column support in Hibernate.

For example: http://johnpremjeetpage.blogspot.cz/2009/06/mapping-hibernate-to-computed-columns.html

Last time I tried to use it in EclipseLink it failed. @ReadOnly annotation is ignored when combined with other annotations, and there was no way how to exclude a virtual column from generated insert statements.

ibre5041
  • 4,903
  • 1
  • 20
  • 35
  • Thank you. Can ROWID for a record change without any notification? Should we not use ROWID to fetch the records? – Udhay Feb 26 '15 at 10:33
  • http://stackoverflow.com/questions/435109/what-can-cause-an-oracle-rowid-to-change. – ibre5041 Feb 26 '15 at 12:56