You might need to upgrade to 2.1.2: http://216.121.112.228/browse/NH-847
--------------------------------------------------
From: "Jakes" <[email protected]>
Sent: Tuesday, August 31, 2010 9:42 AM
To: "nhusers" <[email protected]>
Subject: [nhusers] problem executing oracle stored procedure
Having problems executing stored procedure using oracle
(NHibernate.Dialect.Oracle10gDialect).
Using NHibenate version : 2.1.0.3001
Stored proc looks like this :
[code]
CREATE OR REPLACE
procedure ORDERSTEST(c_test out sys_refcursor) is
BEGIN
open c_test for select * from orders;
END ORDERSTEST;
[/code]
My mapping file looks like this :
[code]
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Niras.Lucrative.Entity.Orders,Niras.Lucrative.Entity"
table="ORDERS">
<id name="Id" column="ID" type="Int32">
<generator class="native">
<param name="sequence">ORDERS_SEQ</param>
</generator>
</id>
<property column="GML" type="string" name="Gml" length="2147483647" /
<property column="WKT" type="string" name="Wkt" length="2147483647" /
<property column="GUID" type="Guid" name="Guid" />
<many-to-one name="KundeId"
class="Niras.Lucrative.Entity.Kunde,Niras.Lucrative.Entity"
cascade="save-update">
<column name="KUNDE_ID" />
</many-to-one>
<many-to-one name="KundeKontaktId"
class="Niras.Lucrative.Entity.KundeKontakt,Niras.Lucrative.Entity"
cascade="save-update" >
<column name="KUNDE_KONTAKT_ID" />
</many-to-one>
<many-to-one name="OutputformatId"
class="Niras.Lucrative.Entity.Outputformat,Niras.Lucrative.Entity">
<column name="OUTPUTFORMAT_ID" />
</many-to-one>
<many-to-one name="ScaleId"
class="Niras.Lucrative.Entity.Scale,Niras.Lucrative.Entity">
<column name="SCALE_ID" />
</many-to-one>
<many-to-one name="PapersizeId"
class="Niras.Lucrative.Entity.Papersize,Niras.Lucrative.Entity">
<column name="PAPERSIZE_ID" />
</many-to-one>
<many-to-one name="OwnerId"
class="Niras.Lucrative.Entity.Owner,Niras.Lucrative.Entity">
<column name="OWNER_ID" />
</many-to-one>
<bag name="Lergraveanmodninglist" cascade="all" inverse="true">
<key>
<column name="ORDERS_ID" />
</key>
<one-to-many
class="Niras.Lucrative.Entity.LerGraveanmodning,Niras.Lucrative.Entity"/
</bag>
<bag name="Overviewmaplist" cascade="all-delete-orphan"
inverse="true">
<key>
<column name="ORDERS_ID" />
</key>
<one-to-many
class="Niras.Lucrative.Entity.OverviewMap,Niras.Lucrative.Entity"/>
</bag>
<bag name="Loglist" cascade="all-delete-orphan" inverse="true">
<key>
<column name="ORDERS_ID" />
</key>
<one-to-many
class="Niras.Lucrative.Entity.Log,Niras.Lucrative.Entity"/>
</bag>
<bag name="Planlist" cascade="all" inverse="true">
<key>
<column name="ORDER_ID" />
</key>
<one-to-many
class="Niras.Lucrative.Entity.Plan,Niras.Lucrative.Entity"/>
</bag>
<bag name="Remarklist" cascade="all" inverse="true">
<key>
<column name="ORDERS_ID" />
</key>
<one-to-many
class="Niras.Lucrative.Entity.Remark,Niras.Lucrative.Entity"/>
</bag>
</class>
<sql-query name="Orderssearch">
<return alias="searchOrders"
class="Niras.Lucrative.Entity.Orders,Niras.Lucrative.Entity" />
{ CALL ORDERSTEST(?) }
</sql-query>
</hibernate-mapping>
[/code]
and my C# code looks like this :
[code]
Session.GetNamedQuery("Orderssearch").List<IOrders>();
[/code]
and im getting the following error :
[quote]
NHibernate.QueryException: Expected positional parameter count: 1,
actual parameters: [] [{ CALL ORDERSTEST(?) }]
at NHibernate.Impl.AbstractQueryImpl.VerifyParameters(Boolean
reserveFirstParameter)
at NHibernate.Impl.AbstractQueryImpl.VerifyParameters()
at NHibernate.Impl.SqlQueryImpl.VerifyParameters()
at NHibernate.Impl.SqlQueryImpl.List<T>()
at Niras.Lucrative.Business.OrdersDomain.SearchOrders(Nullable`1
ownerId, IList`1 orderStatusId, Nullable`1 fromDate, Nullable`1
toDate, Nullable`1 kundeKontaktId, String wktGeometry) in
OrdersDomain.cs: line 206
at Niras.Lucrative.Business.Tests.OrdersDomainTest.SearchOrdersTest()
in OrdersDomainTest.cs: line 317
[/quote]
Any ideas to what im doing wrong?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.