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.  [ 4 posts ] 
Author Message
 Post subject: How to call a simple SQL Query in NHibernate
PostPosted: Thu Mar 06, 2008 4:36 am 
Newbie

Joined: Thu Mar 06, 2008 3:24 am
Posts: 3
We need to execute some SQL statements which are constructed on run time - hence cannot have a HBM or Class corresponding to them.

Can someone please tell what is the method to execute such statements using NHibernate and C#.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 06, 2008 4:49 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Have a look here http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/querysql.html

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 08, 2008 12:26 am 
Beginner
Beginner

Joined: Fri Jan 12, 2007 1:08 am
Posts: 41
Also note that there is nothing about IQuery and ICriteria that prevents runtime query generation, in fact IMHO that is where ICriteria excels.


Top
 Profile  
 
 Post subject: Problem solved
PostPosted: Tue Mar 11, 2008 12:22 am 
Newbie

Joined: Thu Mar 06, 2008 3:24 am
Posts: 3
As per your reply, we used AddScalar to run the query. Thanks for the help !


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