-->
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.  [ 3 posts ] 
Author Message
 Post subject: raw SQL query against parent joined-subclass entity
PostPosted: Fri Jul 25, 2014 4:58 pm 
Newbie

Joined: Thu Dec 01, 2005 6:36 pm
Posts: 8
Location: Chapel Hill, NC
Using Hibernate 3.3.1

Trying to execute a hand coded SQL query against the middle class of a three level set of joined-subclasses. The query I've written executes in TOAD against Oracle 11g. But I'm getting an error back from Hibernate: could not read column value from result set: clazz_; Invalid column name

I've debugged into the Hibernate code, and the query IS successfully executing, but Hibernate is attempting to find a column named "clazz_" and of course it cannot, and throws the exception. I've found a thread here on the forums from 2005 where someone was trying to do something similar, but there was no ultimate resolution. I have yet to try this as an HQL query, but I'm loath to use HQL, since I test my queries in TOAD, refine them, then paste the query into my code. HQL requires met to translate back and forth...an unnecessary step, IMHO.

Hierarchy of the classes:
ENTITY
AGENCYENTITY joined-subclass of ENTITY
AGENCY_NC joined-subclass of AGENCYENTITY
AGENCY_SC joined-subclass of AGENCYENTITY
AGENCY_WV joined-subclass of AGENCYENTITY

This models a generic EMS agency, and the state-specific attributes for agencies in the three states we support. I'm trying to query against AGENCYENTITY, and right now attempting the simplest of all possible queries:

select ae.* from agencyentity ae

I use hand-coded SQL all over the place in this app....but none involve joined-subclasses. Is there a specific problem with trying to use SQL against joined-subclasses? Can anyone indicate what the heck is going on here? I've got 9 years of Hibernate experience, this app has been around for 8 of those years, and this is the first time I've come up against this type of problem. I've been debugging for 2 days now, and I'm getting nowhere.

Any pointers would be hugely appreciated.

Paul Cooper
EMS Performance Improvement Center


Last edited by PaulCooper on Fri Jul 25, 2014 5:10 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: raw SQL query against parent joined-subclass entity
PostPosted: Fri Jul 25, 2014 5:08 pm 
Newbie

Joined: Thu Dec 01, 2005 6:36 pm
Posts: 8
Location: Chapel Hill, NC
A followup:

I changed the query to reference a different class and table which does NOT use joined-subclasses:

select ae.* from destinationlu ae

and the code works as expected.


Top
 Profile  
 
 Post subject: Re: raw SQL query against parent joined-subclass entity
PostPosted: Mon Aug 04, 2014 5:29 pm 
Newbie

Joined: Thu Dec 01, 2005 6:36 pm
Posts: 8
Location: Chapel Hill, NC
Additional follow-up, as perhaps my first follow-up may have lead readers to believe I'd fixed the problem.

The second query was only a test...that query does not satisfy my need to query against a joined-subclass. I can find NO documentation on this, and everything I've tried has failed. Currently I consider this a significant bug in Hibernate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.