-->
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.  [ 2 posts ] 
Author Message
 Post subject: Can we use 'is NULL' in select query
PostPosted: Thu Jul 31, 2008 2:39 am 
Newbie

Joined: Thu Jul 31, 2008 2:09 am
Posts: 2
Hi

Please clarify whether I am right or wrong in this below query

session.Find("SELECT FROM table1 AS t1 WHERE t1.column1 is not NULL ORDER BY t1.column2")

I am not getting data with this query ,Please help me out for this.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 3:39 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
session.Find() is for HQL queries, not direct SQL (as your query looks like). And session.Find() is deprecated (nhib 1.2 and later).

Code:
session.CreateQuery("FROM Class c WHERE c.Property1 is not NULL ORDER BY c.Property2").List();


should definitely work.

_________________
--Wolfgang


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