Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.3
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi all,
When i run my application, this query was generated in hql:
select W.Y.a from X,W where X.Y.s = 55;
The SQL generated for hibernate is:
select y0.a from Y as y0,Y as y1,X as x, W as w where
w.NR_SQ = y0.NR_SQ and x.NR_SQ = y1.NR_SQ and
y1.s = 55.
The hibernate generated 2 alias for the same table, the correct for me would be:
select y.a from Y as y,X as x, W as w where
w.NR_SQ = y.NR_SQ and x.NR_SQ = y.NR_SQ and
y.s = 55.
I compared the results of the queries and they are really different.
How i fix this problem?
Thanks.
Read this:
http://hibernate.org/42.html