Hi,
A jdbc error is happening when I try to execute a query created by a call to session.createFilter.
This only happens when I use setMaxResult and include a select statement in the query.
I'm using Oracle for the database.
The query used in the createFilter function is
select b
from patrim.model.BemUg b
where b.Id = this.Id
order by this.Numero
the select statement generated by hibernate is:
Hibernate: select * from ( select bemug1_.BEM_ID as BEM_ID, bemug1_.BEM_ID as BEM_ID, bemug1_.BEM_VERSAO as BEM_VERSAO, bemug1_.Estado as Estado, bemug1_.ALTERAR_TR as ALTERAR_TR, bemug1_.TR_ID as TR_ID, bemug1_.UG_ID as UG_ID, bemug1_.UO_ID as UO_ID, bemug1_.SALA_ID as SALA_ID, bemug1_.CONTA_ID as CONTA_ID, bemug1_.CORESP_ID as CORESP_ID, bemug1_.TIPO_DOC as TIPO_DOC, bemug1_.DOC_ID as DOC_ID from BENS_DOCSMOV bens0_ inner join VERSOESBEM this on bens0_.BEM_ID=this.BEM_ID and bens0_.VERSAO_BEM=this.BEM_VERSAO, BENSUG bemug1_ where bens0_.DOCMOV_ID = ? and ((bemug1_.BEM_ID=this.BEM_ID )) order by this.Numero ) where rownum <= ?
The first column "BEM_ID" is repeated twice at the beggining of the query, generating an error of "Ambiguous column".
I've tried to update to hibernate 2.1.4 but this error persists.
Any ideias?
Luis Fernando
_________________ Luis Fernando Kauer
|