[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-729) boolean types mapped to bit in MySQL 5 not working with EJB3 in JBoss 4.0.4.GA

Martyn (JIRA) noreply at atlassian.com
Mon Oct 29 07:34:39 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28611 ] 

Martyn commented on HBX-729:
----------------------------

This is actually a Hibernate bug. Why, really simple. Hibernate needs to convert Criteria and such into Queries using the dialects. If you have a boolean property and you try to save the object with that boolean property you will see this in the Mysql log and in the hibernate logging if query logging is set to true:

UPDATE ..... SET BooleanField='1' .......

This is wrong. Mysql doesnt accept bit field to have qoutes. It will complain that '1' is too long. It's 3 characters trying to fit in a BIT(1) field.

> boolean types mapped to bit in MySQL 5 not working with EJB3 in JBoss 4.0.4.GA
> ------------------------------------------------------------------------------
>
>                 Key: HBX-729
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-729
>             Project: Hibernate Tools
>          Issue Type: Bug
>    Affects Versions: 3.2beta6
>         Environment: Debian
>            Reporter: Daniel Pocock
>
> I define a property with type="boolean" in my .hbm.xml
> The generated SQL column defaults to bit(1).  However, when using JBoss 4.0.4.GA and MySQL 5.0.22, reading the property (getXXX()) always return false
> If I force hbm2sql to generate a tinyint column, the boolean works as I would have expected:
> <column name="myColumn" sql-type="tinyint"/>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list