[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1483) MySQL5: No Dialect mapping for JDBC type: -1

Lars Michele (JIRA) noreply at atlassian.com
Fri May 29 16:43:14 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33288#action_33288 ] 

Lars Michele commented on HHH-1483:
-----------------------------------

Hi Gail,

I don't see the necessity for a testcase. Even if the problem occurs with MySQL, it is not MySQL specific.

A look in Dialect.java shows, what for HibernateTypes are registered:

// register hibernate types for default use in scalar sqlquery type auto detection

registerHibernateType maps java.sql.types to HibernateTypes, but some are missing, what generates the No Dialect mapping for JDBC type exception.

The missing java.sql.types are
ARRAY, BOOLEAN, DATALINK, DISTINCT, JAVA_OBJECT, LONGVARBINARY, LONGVARCHAR, NULL, OTHER, REF and STRUCT.
So whenever a native query returns some of these types, an exception is thrown.

Mappable to Hibernate are the following:
		registerHibernateType( Types.LONGVARBINARY, Hibernate.BLOB.getName() );
		registerHibernateType( Types.LONGVARCHAR,  Hibernate.TEXT.getName() );
		registerHibernateType( Types.BOOLEAN, Hibernate.BOOLEAN.getName() );

Related issues:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1806
got fixed in the same manner and fixed also (even if not remarked):
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1468

Have a nice weekend,
Lars

> MySQL5: No Dialect mapping for JDBC type: -1
> --------------------------------------------
>
>                 Key: HHH-1483
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1483
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.2
>         Environment: MySQL 5.0.18-nt
>            Reporter: Sergey Vladimirov
>            Priority: Minor
>         Attachments: hhh-1483-patch.txt
>
>
> MySQL5: No Dialect mapping for JDBC type: -1
> SELECT answpos,answer  FROM votes_answers WHERE question=? ORDER BY answpos
> mysql> describe votes_answers;
> +----------+---------+------+-----+---------+-------+
> | Field    | Type    | Null | Key | Default | Extra |
> +----------+---------+------+-----+---------+-------+
> | question | int(11) | NO   | MUL |         |       |
> | answpos  | int(11) | NO   |     |         |       |
> | answer   | text    | YES  |     | NULL    |       |
> +----------+---------+------+-----+---------+-------+
> mysql> describe temp;
> +---------+---------+------+-----+---------+-------+
> | Field   | Type    | Null | Key | Default | Extra |
> +---------+---------+------+-----+---------+-------+
> | answpos | int(11) | NO   |     | 0       |       |
> | answer  | text    | YES  |     | NULL    |       |
> +---------+---------+------+-----+---------+-------+
> Please, let me know what to add to MySQL5Dialect :)
> Will it be ok to add? :
> registerColumnType( Types.LONGVARCHAR, "text" );

-- 
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