Hi
Problem was reproduce with 2.0.3 and 2.1.7
Im doing a SQL Query but hibernate seems to use the wrong table mapping,
My code looks like:
String sql = "select {componentlogs.*} from logs {componentlogs} where rowid in(select rid " +
"from (select rowid rid, rownum rnum from (" +
"SELECT rowid rid FROM logs where componentno = " + componentno + " " +
buildFilter() + " order by " + orderBy +
")) where rnum >= :from and rnum < :to)";
Query query = session.createSQLQuery(sql,"componentlogs", Logs.class);
query.setLong("from", itemFrom);
query.setLong("to", itemTo);
return query.list();
I receive a SQLException ORA-00904: "MODIFICATIONDATE": invalid identifier but there is not MODIFICATIONDATE column in the Logs table mapping... What is hibernate using to map the mapping and the query,, is it using the Logs.class?
Maybe its a Hibernate bug, i've been using hibernate for the last 6 months and its the first time i have something strange like that...
Thanks
Richard
|