Nhibernate map sql stored procedure to entity?

Change persistence. Xml by adding this property.

Up vote 0 down vote favorite share g+ share fb share tw.

Edited: I found another solution to call stored procedure via NHibernate and map it on my entity: var campaignsItems = nhSession. CreateSQLQuery("exec Select_List_Campaigns :currentLatDegrees, :currentLonDegrees, :radiusInMiles, :pageSize, :currentPage, :search, :isTop, :topDealPercente") . SetParameter("currentLatDegrees", currentLatDegrees) .

SetParameter("currentLonDegrees", currentLonDegrees) . SetParameter("radiusInMiles", radius) . SetParameter("pageSize", pageSize) .

SetParameter("currentPage", page) . SetParameter("search", search) . SetParameter("isTop", isTop) .

SetParameter("topDealPercente", topDealPercente) . SetResultTransformer(Transformers.AliasToBean()) .List(); As you can see, here we can Set parameters and map results to our Entity with SetResultTransformer help. If properties in your class equals to the name of the columns in your stored procedure result set then all be fine.

Old question: I have some stored procedure and whant to map my entity to result record set of this stored procedure. My hbm file: exec Select_Latest_Campaigns :currentLatDegrees, :currentLonDegrees, :radiusInMiles, :pageSize, :currentPage, :search When I try to execute this query, I have this exception: Exception Details: NHibernate. HibernateException: Errors in named queries: {Select_Latest_Campaigns} On: Line 43: return configuration.

BuildSessionFactory(); Any ideas what wrong? Nhibernate-mapping hbm sql link|improve this question edited Jun 9 '11 at 13:03 asked Jun 8 '11 at 9:50Ang74.

Change persistence. Xml by adding this property: I hope this help if not let me know what is you sql version!?

I haven't persistence. Xml file. I use Fluent NHibernate for mapping all my entities, only for this stored procedure I whant use hbm.

Xml file. Where I can set this property and for what? – Ang Jun 9 '11 at 12:58.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions