-->
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: Problem with boolean mapping in mysql 5
PostPosted: Mon Oct 22, 2007 11:07 am 
Newbie

Joined: Mon Oct 22, 2007 10:37 am
Posts: 1
Hello Good people,

I am having a very frustrating problem and I hope someone can help me.
I am using a web application with mysql 5.0.27 and hibernate 2.1 (I know it's old, but we can't upgrade at this point).

Occasionaly, after a transaction I see that MySQL is complaining about "com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column...". I also noticed that it is always columns of type bit(1).
After a research over the web I understood that mysql changed thier bit field support in version 5.0.5 and I saw some articles suggesting to avoid working with bit fields.
The problem is that hibernate keeps mapping java.boolean to bit(1) columns.

My question is how can I change this mapping and to force hibernate to map boolean into tinyint(1).
I bumped into the dialect classes but I think I didn't do it correctly since nothing happened.

Any help will be highly appriciated - I am working on this for days.
Thanks
TS.


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.