I have the following Mapping file. <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" > <class name="WindowsFormsSql.Model.TestInstrument, WindowsFormsSql" table="v_AllInstrumentsRak" lazy="false"> <composite-id> <key-property name="Id" column="Id" type="string" ></key-property> <key-property name="MarketId" column="MarketId" type="string"></key-property> </composite-id> <property name="Benchmark" column="Benchmark" /> <property name="BondPV01" column="BondPV01" /> <property name="ClosingPrice" column="ClosingPrice" /> <property name="Currency" column="Currency" /> <property name="DateMaturity" column="DateMaturity" /> <property name="DateSettlementWestminster" column="DateSettlementWestminster" /> <property name="DateSettlementIon" column="DateSettlementIon" /> <property name="Description" column="Description" /> <property name="DisplayName" column="DisplayName" /> <property name="IdCtd" column="IdCtd" /> <property name="MaturityBucket" column="MaturityBucket" /> <property name="NumberOfLegs" column="NumberOfLegs" /> <property name="OfficialId" column="OfficialId" /> <property name="OptionStrikePrice" column="OptionStrikePrice" /> <property name="QtyDec" column="QtyDec" /> <property name="QtyMax" column="QtyMax" /> <property name="QtyMin" column="QtyMin" /> <property name="QtyMinAggr" column="QtyMinAggr" /> <property name="QtyMinFAS" column="QtyMinFAS" /> <property name="QtyNominal" column="QtyNominal" /> <property name="QtyTick" column="QtyTick" /> <property name="QuoteQtyTick" column="QuoteQtyTick" /> <property name="QuotingSide" column="QuotingSide" /> <property name="SecurityType" column="SecurityType" /> <property name="StrategyType" column="StrategyType" /> <property name="Segment" column="Segment" /> <property name="SubMarket" column="SubMarket" /> <property name="ValueDec" column="ValueDec" /> <property name="ValueFmt" column="ValueFmt" /> <property name="ValueMax" column="ValueMax" /> <property name="ValueMin" column="ValueMin" /> <property name="ValueTick" column="ValueTick" /> <property name="ValueType" column="ValueType" /> <property name="ApplicationId" column="ApplicationId" /> </class> <sql-query name="GetApplInstrumentsById" > <return class="WindowsFormsSql.Model.TestInstrument, WindowsFormsSql" > <return-property name="Id" column="Id" /> <return-property name="MarketId" column="MarketId" /> <return-property name="Benchmark" column="Benchmark" /> <return-property name="BondPV01" column="BondPV01" /> <return-property name="ClosingPrice" column="ClosingPrice" /> <return-property name="Currency" column="Currency" /> <return-property name="DateMaturity" column="DateMaturity" /> <return-property name="DateSettlementWestminster" column="DateSettlementWestminster" /> <return-property name="DateSettlementIon" column="DateSettlementIon" /> <return-property name="Description" column="Description" /> <return-property name="DisplayName" column="DisplayName" /> <return-property name="IdCtd" column="IdCtd" /> <return-property name="MaturityBucket" column="MaturityBucket" /> <return-property name="NumberOfLegs" column="NumberOfLegs" /> <return-property name="OfficialId" column="OfficialId" /> <return-property name="OptionStrikePrice" column="OptionStrikePrice" /> <return-property name="QtyDec" column="QtyDec" /> <return-property name="QtyMax" column="QtyMax" /> <return-property name="QtyMin" column="QtyMin" /> <return-property name="QtyMinAggr" column="QtyMinAggr" /> <return-property name="QtyMinFAS" column="QtyMinFAS" /> <return-property name="QtyNominal" column="QtyNominal" /> <return-property name="QtyTick" column="QtyTick" /> <return-property name="QuoteQtyTick" column="QuoteQtyTick" /> <return-property name="QuotingSide" column="QuotingSide" /> <return-property name="SecurityType" column="SecurityType" /> <return-property name="StrategyType" column="StrategyType" /> <return-property name="Segment" column="Segment" /> <return-property name="SubMarket" column="SubMarket" /> <return-property name="ValueDec" column="ValueDec" /> <return-property name="ValueFmt" column="ValueFmt" /> <return-property name="ValueMax" column="ValueMax" /> <return-property name="ValueMin" column="ValueMin" /> <return-property name="ValueTick" column="ValueTick" /> <return-property name="ValueType" column="ValueType" /> <return-property name="ApplicationId" column="ApplicationId" /> </return> exec Espada.dbo.p_GetInstrumentsByIdRak :appId </sql-query> </hibernate-mapping>
I can select fine IList<TestInstrument> list = PersistenceManager.RetrieveAll<TestInstrument>()
However using the Stored Proc I get an exception - at System.Data.ProviderBase.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.Type.AbstractType.Hydrate(IDataReader rs, String[] names, ISessionImplementor session, Object owner) at NHibernate.Type.ComponentType.Hydrate(IDataReader rs, String[] names, ISessionImplementor session, Object owner) at NHibernate.Type.ComponentType.NullSafeGet(IDataReader rs, String[] names, ISessionImplementor session, Object owner) at NHibernate.Loader.Loader.GetKeyFromResultSet(Int32 i, ILoadable persister, Object id, IDataReader rs, ISessionImplementor session) at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet,
with Message = "Id3_0_"
Has anyone seen this, or knows what cuases it or how to fix this?
thanks
|