If I use this HQL it doesn't work ( with 'exp' ), because it returns 'Objects' instead of 'Expedients', and that objects can not be casted to expedients
Code:
SELECT exp FROM Expedient as exp, Tramit as tra where
exp.estado = '11' and
tra.comp_id.numexp = exp.numexp and
((exp.expedientesTipologia.codtip = 'PPL' and tra.codtra = 'BOPA13' ) or (exp.expedientesTipologia.codtip = 'PL' and tra.codtra = 'BOPA10'))
order by tra.fectra desc
But if I use this HQL it works perfectly (with 'expe' or whatever )
Code:
SELECT expe FROM Expedient as exp, Tramit as tra where
expe.estado = '11' and
tra.comp_id.numexp = expe.numexp and
((expe.expedientesTipologia.codtip = 'PPL' and tra.codtra = 'BOPA13' ) or (expe.expedientesTipologia.codtip = 'PL' and tra.codtra = 'BOPA10'))
order by tra.fectra desc
Why??