Forums Register Login

Boolean mapping

+Pie Number of slices to send: Send
Greetings!

I'm using Netbeans, Glassfish V2 and MySQL 5 and the boolean map doesn't work



either if it's Boolean or boolean, always map to a TINYINT(1), I know that MySQL have a BOOLEAN type, how can I do that?

regards
+Pie Number of slices to send: Send
How do you know the boolean mapping is not working? Is there a design time error message? A runtime error message.

This mapping works fine for Boolean values on MySQL through NetBeans and Eclipse.



What's the heart of the problem?

-Cameron McKenzie
+Pie Number of slices to send: Send
no, it doesn't give an error...

the problem is that in MySQL administrator I open the table and it is TINYINT(1), therefore I can put values like -1, 3, and so on
I just want to put true or false.. thats the problem, the direct acess, not the mapping, I want a BOOLEAN column

thanks
+Pie Number of slices to send: Send
nobody?
+Pie Number of slices to send: Send
I'm wondering what would happen if you just set the data-type in MySQL to a boolean type, and then ran your code. Would Hibernate hick-up, demanding a TinyInt, or would it just run well.

Of course, it doesn't solve the mapping to database creation problem, but it would be interesting.

-Cameron McKenzie
+Pie Number of slices to send: Send
Hi,
MYSQL supports boolean data type. You can either use BOOL or Boolean or TINYINT(1).
Thanks
Sudha
+Pie Number of slices to send: Send
sudha: I know that, my problem is that the toplink.ddl-generation creates a table with a TINYINT type instead my field type boolean, capiche?

Cameron:
I treat that field in my java code giving values true or false, and its persisted in table as 1 or 0. Everything works, but I still have to add and check operation in mysql to avoid direct insertion (I mean directly in mysql administrator for example)

regards
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2297 times.
Similar Threads
Any advantage with this style?
Mapping ENUM('0', '1') or CHAR(0) for Boolean
get action property
HashMap Problem
criteriaFind
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:02:04.