-->
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: Is this a bug? Unknown column error for base class property
PostPosted: Sat Oct 01, 2005 9:28 pm 
Beginner
Beginner

Joined: Tue Apr 12, 2005 9:15 pm
Posts: 24
I have a query that works fine if query.factory_class is defined as ClassicQueryTranslatorFactory however doesn't work when query.factory_class defined as ASTQueryTranslatorFactory

The error says : With JDBC exception on Hibernate data access: could not execute query; nested exception is java.sql.SQLException: Unknown column 'classb2_1_.ISVALID' in 'where clause'

The Hibernate query that gets generated looks something like this:
select distinct employer0_.ID as ID1_59_ from EMPLOYER employer0_ left outer join CLASSB classb1_
on employer0_.ID=classb1_.EMP_ID left outer join BASECLASSA classb1_1_ on
classb1_.cid=classb1_1_.cid where 1=1 and (employer0.emp_name like ?) and
( not (exists (select classb2_.cid from CLASSB classb2_ where employer0_=classb2_.cid and
classb2_1_.ISVALID=1
)))

If you notice, for the inner not exists part, even though the query has a where with classb2_1_1.ISVALID, the from doesn't have that class specified in the join.

Is it at all possible to include a " where not exists (from eg.Cat as child where child.type = 'yy') for a base class property with the collection being of the derived class? or is this a bug?


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.