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