[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6935) HibernateException in mysql Found: bit, expected: boolean

Jan Hodac (JIRA) noreply at atlassian.com
Tue Apr 17 02:47:48 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-6935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46314#comment-46314 ] 

Jan Hodac commented on HHH-6935:
--------------------------------

I have similar problem with this change on MSSQL. When i use HQL query

{code}
session.createQuery("select cast(:p as boolean) from SomeTable").setBoolean("p", true).uniqueResult();
{code}

on hibernate 3.6.8 its OK but on hibernate 4.0.0.Final results in

{code}
org.hibernate.exception.SQLGrammarException: Type boolean is not a defined system type.
	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122)
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
	at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
	at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
{code}

3.6.8 SQL: select cast(? as tinyint) as col_0_0_ from .... 
4.0.0 SQL: select cast(? as boolean) as col_0_0_ from .... 

I agree with [~Manthos] that this issue is more than Major priority

> HibernateException in mysql Found: bit, expected: boolean
> ---------------------------------------------------------
>
>                 Key: HHH-6935
>                 URL: https://hibernate.onjira.com/browse/HHH-6935
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.Final
>         Environment: spring jpa hibernate project above mysql 5.1
>            Reporter: orasio spieler
>              Labels: BooleanType, mysql
>         Attachments: hib4-check.zip
>
>
> Found the problem i also got org.hibernate.HibernateException: Wrong column type ... Found: bit, expected: boolean
> on BooleanType in hibernate 4 they changed the Ctor to
> public BooleanType() {
>     this( org.hibernate.type.descriptor.sql.BooleanTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE );
> }
> instead of old versions
> public BooleanType() {
>     this( BitTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE );
> }
> spieler.orasio at gmail.com

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list