-->
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.  [ 3 posts ] 
Author Message
 Post subject: Help, Store Procedure with Nhibernate..
PostPosted: Thu Jul 05, 2007 5:18 am 
Newbie

Joined: Thu Jul 05, 2007 4:55 am
Posts: 4
hi, i'm a strage error when i execute my code...the excepiotn is this:

{"The type initializer for 'Ciclo.Data.NHibernate.DAOSession' threw an exception."}

my table:

RequestProfileProposal(ID,IDprofileRequest,IDConsultant,IDManager,InsertTime,Note,Available)

my store procedure:

ALTER PROCEDURE dbo.sp_provaNicola ( @IDConsultant INT = '428' ) AS

SELECT
IDConsultant AS consultant_id
FROM
RequestProfileProposal
WHERE
IDConsultant = @IDConsultant

my mapping file:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Ciclo.Core" assembly="Ciclo.Core">
<class name="RequestProfileProposals" lazy="false" table="RequestProfileProposal">
<id name="ID" access="property" type="System.Int32">
<column name="ID" />
<generator class="native" />
</id>

<property name="IDProfileRequest" type="System.Int32"/>
<property name="IDConsultant" type="System.Int32"/>
<property name="IDManager" type="System.Int32"/>
<property name="InsertTime" type="System.DateTime"/>
<property name="Note" type="System.String"/>
<property name="Available" type="System.Boolean"/>

<sql-query name="sp_provaNicola">
<return-property name="IDConsultant" column="IDConsultant" >
</return-property>
exec sp_provaNicola :IDConsultant
</sql-query>

</class>
</hibernate-mapping>

my method:

public List<RequestProfileProposals> Sp_ProvaNicola_Method(int IDConsultant)
{

ISession session = DAOSession.BuildSessionFactory().OpenSession();

IQuery iQuery = session.GetNamedQuery("sp_provaNicola").SetInt32("IDConsultant", IDConsultant).SetResultTransformer(new global::NHibernate.Transform.AliasToBeanConstructorResultTransformer(typeof(RequestProfileProposals).GetConstructors()[0]));

session.Close();

return iQuery.List<RequestProfileProposals>() as List<RequestProfileProposals>;
}

Can someone help me?? tanks a lot..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 6:09 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

You are in wrong forum. please visit NHibernate forum to find quick solutions.

Amila

(Don't forget to rate if helps)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 6:13 am 
Newbie

Joined: Thu Jul 05, 2007 4:55 am
Posts: 4
[quote="amila733"]Hi

You are in wrong forum. please visit NHibernate forum to find quick solutions.

Amila

(Don't forget to rate if helps)[/quote]

ops...sorry...do you know can i move my post in the .Net section?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.