-->
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 Hibernate handles null values
PostPosted: Fri Mar 03, 2006 1:54 pm 
Newbie

Joined: Tue Feb 14, 2006 6:03 pm
Posts: 3
Hi All,

How does hibernate handles null values.

I am searching some entity using some values, at runtime of these values may be null. In this situation how does hinbernate handles null values. for example I am searching for person details with his emp ID but emp ID value is null .

Thanks,


Top
 Profile  
 
 Post subject: SQL
PostPosted: Fri Mar 03, 2006 3:34 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I suggest looking at the SQL that H generates and uses to perform your search and I think you will know exactly what will happen in case of nulls.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: SQL
PostPosted: Fri Mar 03, 2006 6:45 pm 
Newbie

Joined: Tue Feb 14, 2006 6:03 pm
Posts: 3
Usually if the passed paramter is of object type and if that object is null then it will throw SQL exception saying- required [type], found binary.


Top
 Profile  
 
 Post subject: property
PostPosted: Fri Mar 03, 2006 6:52 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
If you try to access properties of a null object in HQL than I would say it is expected reaction.
Unfortunately in the named queries H does not have conditional blocks like iBatis therefore you need to make sure that all the used objects are not null ...

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.