-->
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.  [ 1 post ] 
Author Message
 Post subject: Query on superclass tries to run on a sub class.
PostPosted: Wed Dec 06, 2006 7:19 pm 
Newbie

Joined: Tue Feb 21, 2006 6:43 pm
Posts: 4
I have super class A which is backed by a table A in the database. I also have 2 sub classes to this super Class namely AB and AC. These classes are not backed by table in the data base. The hibernate mapping files for all the pojos do not indicate that one is base class and other are sub classes.

Now when i run a query of select * from A, Hibernate tries to run select * from AB. Since there is no table AB in the database, i get a sql error.

I did some digging in using Debug mode in eclipse and found that Hibernate actually translates the query to 3 sql queries, one for base class and two for the sub classes and stores it in hashmap or just array.

Why is hibernate trying to get the sub classes when in the mapping files there is no relation ship between these classes.


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

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.