Hi, i'm trying to migrate to beta version of NHibernate and i'm experiencing oracle parameters parsing problem with a very simplistic call (nor functions nor procs).
There must be some bug as this query does not have parameters...
Hibernate version:
1.2.0.Beta1
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" namespace="Be.StibMivb.SVoi.Domain" assembly="Be.StibMivb.SVoi.Domain" default-access="field.camelcase-underscore" default-lazy="false">
<class name="Depot" table="Depots" mutable="false">
<jcs-cache usage="read-only" />
<id name="ObjectId" unsaved-value="0" column="Id" type="Int32">
<generator class="assigned"/>
</id>
<property name="Created" column= "Created" update="false"/>
<property name="CreatedBy" column= "CreatedBy" update="false" type="String" length="50"/>
<property name="Modified" column="Modified" />
<property name="ModifiedBy" column="ModifiedBy" type="String" length="50"/>
<property name="Code" column= "Code" type="String" length="10"/>
<property name="Description" column= "Description" type="String" length="255"/>
<property name="TransportModes" column= "TransportModes" type="Be.StibMivb.SVoi.Domain.TransportModes, Be.StibMivb.SVoi.Domain" />
</class>
</hibernate-mapping>
Here's an extract of the code:
public virtual void TestSimpleSelect()
{
ICriteria criteria = Session.CreateCriteria(MappedType);
criteria.SetMaxResults(5);
IList results = criteria.List();
Assert.IsNotNull(results, "Criteria.List returned a null value.");
Assert.IsTrue(results.Count > 0, "Criteria.List returned and empty list.");
foreach(object item in results)
Assert.IsTrue(MappedType.IsAssignableFrom(item.GetType()), string.Format("Loaded items are not inheriting from {0}.", MappedType.GetType().FullName));
Debug.WriteLine(results.Count.ToString() + " items loaded." );
}
Full stack trace of any exception that occurs:
at System.Data.OracleClient.OracleParameterCollection.RangeCheck(Int32 index)
at System.Data.OracleClient.OracleParameterCollection.GetParameter(Int32 index)
at System.Data.Common.DbParameterCollection.System.Collections.IList.get_Item(Int32 index)
at NHibernate.Loader.Loader.BindLimitParameters(IDbCommand st, Int32 index, RowSelection selection, ISessionImplementor session) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 1246
at NHibernate.Loader.Loader.PrepareQueryCommand(SqlString sqlString, QueryParameters parameters, Boolean scroll, ISessionImplementor session) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 1196
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 391
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 183
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 1646
--- End of inner exception stack trace ---
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 1656
at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 1600
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Loader.cs:line 1594
at NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor session) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Loader\Criteria\CriteriaLoader.cs:line 66
at NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria, IList results) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 5047
at NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Impl\SessionImpl.cs:line 4989
at NHibernate.Impl.CriteriaImpl.List() in c:\net\nhibernate-1.2.0.Beta1\nhibernate\src\NHibernate\Impl\CriteriaImpl.cs:line 300
at Be.StibMivb.SVoi.Domain.Test.HibernateMappingTest.TestSimpleSelect() in E:\My Projects\StibMivb\SVoi\Design And Implementation\Src\Be.StibMivb.SVoi.Domain.Test\HibernateMappingTest.cs:line 35
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
SELECT this_.Id as Id1_0_, this_.Created as Created1_0_, this_.CreatedBy as CreatedBy1_0_, this_.Modified as Modified1_0_, this_.ModifiedBy as ModifiedBy1_0_, this_.Code as Code1_0_, this_.Description as Descript7_1_0_, this_.TransportModes as Transpor8_1_0_ FROM Depots this_
I'm stuck :(
|