-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Trouble with extends files
PostPosted: Thu Sep 16, 2004 7:16 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
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?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 7:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Do you understand Hibernate implicit polymorphism?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 7:42 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
No, that's the first time, I hear about implicit polymorphism in Hibernate.

Would you be so kind to explain, what it is, or post a link to the fascinating material?


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Thu Sep 16, 2004 8:00 am 
Newbie

Joined: Thu Sep 16, 2004 6:03 am
Posts: 15
Location: Moscow, Russia
Thank you!

I found material about it. And now it works.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.