-->
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.  [ 1 post ] 
Author Message
 Post subject: query#setFloat() with null values
PostPosted: Wed Jul 06, 2005 5:40 am 
Newbie

Joined: Tue Jun 21, 2005 5:23 am
Posts: 8
Hi

Whats the prefered way to handle null values?

// pseudocode
Code:
dao.get(Float value) {
if(value == null) {
  query = ..createQuery("select ... where m.value is null");
} else {
  query = ..createQuery("select ... where m.value = :value");
  query.setFloat("value", value);
}
}


Is not really handy. Is there an easier way to write a more generic dao method?

I hoped that something like query.setFloat("value", value); would be able to deal with null values ;o)

Hibernate version: 3.0.5

thx for your assistence
Bernhard Neuhauser


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.