Hibernate version: 3
Code between sessionFactory.openSession() and session.close():
Code:
String query = "SELECT {t.*} FROM TRANSLATION {t}, RESOURCE_KEY {rk} WHERE {t}.LOCALE_ID = '3' AND {t}.KEY_ID = {rk}.id";
SQLQuery sqlQuery = session.createSQLQuery(query);
sqlQuery.addEntity("t", Translation.class);
sqlQuery.addEntity("rk", ResourceKey.class);
sqlQuery.list();
Full stack trace of any exception that occurs:
[java] WARN - SQL Error: 17006, SQLState: null
[java] ERROR - Invalid column name
Name and version of the database you are using: Oracle 9iThe generated SQL (show_sql=true):
Code:
SELECT t.ID as ID0_, t.KEY_ID as KEY2_3_0_, t.LOCALE_ID as LOCALE3_3_0_, t.REVISION_DATE as REVISION4_3_0_, t.TRANSLATOR_ID as
TRANSLATOR5_3_0_, t.TRANSLATION_TEXT as TRANSLAT6_3_0_ FROM TRANSLATION t, RESOURCE_KEY rk WHERE t.LOCALE_ID = '3' AND t.KEY_ID = rk.id
Hi, apparently the problem disspears if i add to the SELECT the ResourceKey table. But this is not what i want, because i only need the Translation table fields. What im doing wrong?. And I need to use Native SQL because this is only a part of my SQL query that use UNION. Thanks for your help!
Bye!