-->
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: Problem with IQuery
PostPosted: Sat Aug 20, 2005 10:56 am 
Hi, I have a problem with this IQuery:

Code:
IQuery consulta = sesion.CreateQuery( "SELECT SUM(m.Importe*m.TipoMovimientoCaja.Signo) FROM MovimientoCaja m WHERE m.Fecha < :Hasta" );
consulta.SetDateTime( "Hasta", hastaFecha );


When I call consulta.List() I get an ADO Exception: (from log)

2005-08-20 11:53:00,641 - [INFO ] NHibernate.Loader.Loader - select SUM(movimien0_.Importe*tipomovi1_.Signo) as x0_0_ from MovimientosCaja movimien0_, TiposMovimientoCaja tipomovi1_ where movimien0_.IDTipoMovimientoCaja=tipomovi1_.IDTipoMovimientoCaja and ((movimien0_.Fecha<@p0))
2005-08-20 11:53:00,651 - [INFO ] NHibernate.Impl.BatcherImpl - Preparing select SUM(movimien0_.Importe*tipomovi1_.Signo) as x0_0_ from MovimientosCaja movimien0_, TiposMovimientoCaja tipomovi1_ where movimien0_.IDTipoMovimientoCaja=tipomovi1_.IDTipoMovimientoCaja and ((movimien0_.Fecha<@p0))
2005-08-20 11:53:01,452 - [ERROR] NHibernate.ADOException - Could not execute query
System.IndexOutOfRangeException: x1_0_
at System.Data.Common.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at NHibernate.Driver.NHybridDataReader.GetOrdinal(String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String[] names, ISessionImplementor session, Object owner)
at NHibernate.Hql.QueryTranslator.GetResultColumnOrRow(Object[] row, IDataReader rs, ISessionImplementor session)
at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, IList hydratedObjects, Object optionalObject, Object optionalId, Key[] keys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
at NHibernate.Hql.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)


Somebody can help me?

Thanks


Top
  
 
 Post subject:
PostPosted: Sat Aug 20, 2005 2:28 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This looks like a bug, it would be nice if you could create a JIRA issue with a simple test case for it.


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.