What JDBC driver are you using? (I've got a funny feeling it might be
Oracle, which does not differentiate between null and the empty string in
its driver.)

Hibernate doesn't do this. Your code, or possibly your JDBC driver might do
it.

Put a breakpoint in your setter method to discover exactly *where* it gets
set to null and I might be able to give some more guidance....




                                                                                       
                                               
                    Jaroslav Misura                                                    
                                               
                    <[EMAIL PROTECTED]>                  To:     [EMAIL PROTECTED]     
                        
                    Sent by:                                cc:                        
                                               
                    [EMAIL PROTECTED]       Subject:     [Hibernate] null check and 
update, save                      
                    eforge.net                                                         
                                               
                                                                                       
                                               
                                                                                       
                                               
                    18/02/03 11:35 PM                                                  
                                               
                    Please respond to Jaroslav Misura                                  
                                               
                                                                                       
                                               
                                                                                       
                                               




Hi,

while I was writing tests for my code I ran into one "problem". Now,
I'm not sure if it is a bug or a feature. I am using Hibernate 1.2.3
and MySQL 3.x .

Some of properties in my JavaBean are marked as not null. When I test
the code I set that property to null and try to save() it. The exception
is thrown - as expected. But when I try to do the same and update() the
code the exception is NOT thrown. Value of that property (string) is
set to "" instead. When I use saveOrUpdate(), it works - just like with
save().
Is there something I misunderstand with update()?

I have some test that shows this problem, so if this is not expected
behavior I can send it together with the debug info etc.

thanks in advance!

jaro.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**********************************************************************
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**********************************************************************





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to