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.
|