-->
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.  [ 2 posts ] 
Author Message
 Post subject: setMaxResults on Informix DB Server
PostPosted: Mon Oct 18, 2004 5:00 am 
Newbie

Joined: Fri Oct 15, 2004 5:47 am
Posts: 2
Location: Florence, Italy
We use criterias to query an Informix server, it seems that InformixDialect correctly interprets setMaxresults() (see "first ?" on the generated SQL below), but the server throws an incorrect sql exception.

We couldn't find any information about that, maybe we can issue a bug report?

Thanks for your help.

Hibernate version: 2.1.6

Database: Informix

Criteria used:
Code:
      Criteria c = HibernateUtil.getSession().createCriteria( Atto.class );
         c.add( Expression.eq( "id" , new Long(codiceIdentificativo) ) );
         c.add( Expression.like( "descrizione" , ta.getDescrizione()
         c.add( Expression.eq( "leggeCollegata" , lc ) );
         c.add( Expression.like( "dittaProvenienza" , "%" + provenienza + "%" ) );
         c.add( Expression.ge( "data" , Convert.stringToDate(dataAttoDa) ) );
         c.add( Expression.le( "data" , Convert.stringToDate(dataAttoA) ) );
         c.add( Expression.like( "note" , "%" + note + "%" ) );
      c.setMaxResults( 100 );
           List lista = c.list();


The generated SQL (show_sql=true):
Code:
select first ? this.id as id5_, this.tipo_atto as tipo_atto5_, this.descrizione as descrizi3_5_, this.data as data5_, this.ditta_provenienza as ditta_pr5_5_, this.numero_registrazione as numero_r6_5_, this.data_registrazione as data_reg7_5_, this.id_comune_registrazione as id_comun8_5_, this.numero_trascrizione as numero_t9_5_, this.data_trascrizione as data_tr10_5_, this.id_comune_trascrizione as id_comu11_5_, this.notaio as notaio5_, this.agli_atti as agli_atti5_, this.note as note5_, this.importo as importo5_, this.id_legge_collegata as id_legg16_5_, this.attiva as attiva5_, this.id_tipo_servitu as id_tipo18_5_, this.reversale as reversale5_, this.data_reversale as data_re20_5_, this.id_titolare_servitu as id_tito21_5_, this.acquirente as acquirente5_, this.venditore as venditore5_, comune1_.id as id0_, comune1_.nome as nome0_, comune1_.provincia as provincia0_, comune1_.sigla_provincia as sigla_pr4_0_, comune1_.codice as codice0_, comune2_.id as id1_, comune2_.nome as nome1_, comune2_.provincia as provincia1_, comune2_.sigla_provincia as sigla_pr4_1_, comune2_.codice as codice1_, leggecolle3_.id as id2_, leggecolle3_.legge as legge2_, tiposervit4_.id as id3_, tiposervit4_.descrizione as descrizi2_3_, titolare5_.id as id4_, titolare5_.descrizione as descrizi2_4_ from atto this left outer join comune comune1_ on this.id_comune_registrazione=comune1_.id left outer join comune comune2_ on this.id_comune_trascrizione=comune2_.id left outer join legge_collegata leggecolle3_ on this.id_legge_collegata=leggecolle3_.id left outer join tipo_servitu tiposervit4_ on this.id_tipo_servitu=tiposervit4_.id left outer join titolare titolare5_ on this.id_titolare_servitu=titolare5_.id where 1=1


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 10:36 pm 
Regular
Regular

Joined: Tue Sep 30, 2003 11:27 am
Posts: 60
Location: Columbus, OH, USA
FYI have a look at http://forum.hibernate.org/viewtopic.ph ... t=informix
Scott


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.