-->
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: Error in a createFilter query
PostPosted: Thu Jul 29, 2004 9:08 am 
Newbie

Joined: Tue Jul 06, 2004 12:39 pm
Posts: 5
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


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.