-->
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: Char column inserting value despite not setting hibernate at
PostPosted: Wed May 17, 2006 4:11 pm 
Newbie

Joined: Thu May 04, 2006 12:57 am
Posts: 8
I have a table which a column of type char(1) and default value is null
My Hibernate Object has an attribute which is of type char
When I try to insert a record in the table.
I dont set the status to any value and do a session.save.
The status column is populated with a value and not its default value null.
Can u pls help?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 17, 2006 11:57 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
char is a primitive type, like int. It can't be null: it can be the null character ('\0'), but not null.

You probably want to change the type of the field (in your java code) to Character. You shouldn't have to change your mapping or anything else: autoboxing will look after all of that.

_________________
Code tags are your friend. Know them and use them.


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.