Hibernate version:2.1.6
Hello!
I have two classes Foo and Bar.
Class Bar extends class Foo and nothing more.
When I try to get a list of Foo elements using Query class, Hibernate returns me a list of Bar elements.
When I set debug level for log4j.logger.net.sf.hibernate. I found the next message.
Quote:
13:34:04,841 DEBUG SessionImpl:1497 - find: SELECT foo FROM foo IN CLASS my.Foo
13:34:04,841 DEBUG QueryTranslator:147 - compiling query
13:34:04,857 DEBUG QueryTranslator:147 - compiling query
net.sf.hibernate.QueryException: could not resolve property: roles of: my.Bar [SELECT foo FROM foo IN CLASS my.Bar]
It seems that hibernate substitutes Bar instead of Foo, while query.getQueryString() returns the query with Foo.
How can I retrieve a list of Foos?