-->
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: nullable doesn't work
PostPosted: Mon Jun 21, 2010 9:03 am 
Beginner
Beginner

Joined: Wed Mar 03, 2010 4:06 am
Posts: 21
Hi,

I just want to insert in one of my tables a record with some optional values. Here a little snippet:
Code:

...

   @ManyToOne(fetch = FetchType.EAGER, optional = true)
   @JoinColumn(name = "value", nullable = true, )
   public Table2 getValue() {
      return this.value;
        }

...


Exactly this is my problem. If I set value = null Hibernate creates an insert statement like "Insert Into Table1(...., value) Values(....,'')

Why the hell does hibernate creates an empty string instead of just passing NULL to the statement?

Jonny


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.