Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-7291

HHH-2304 - Wrong type detection for sql type char(x) columns

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.2.0
    • EAP 5.0.0
    • Hibernate
    • None
    • Hibernate 3.3.2.GA, Oracle 9.2, Oracle JDBC driver 10.2

    • Release Notes
    • Workaround Exists
    • Hide

      Customer created a class which extends the dialect they are using and added the line below in constructor:

      registerHibernateType( Types.CHAR,255, Hibernate.STRING.getName() );

      Show
      Customer created a class which extends the dialect they are using and added the line below in constructor: registerHibernateType( Types.CHAR,255, Hibernate.STRING.getName() );
    • Hide
      When executing a SQL query that returns values of the <literal>char</literal> SQL data type, a value of the <literal>java.lang.Character</literal> data type was returned, regardless of the <literal>char</literal> data type length. This caused that only the first character of the value was returned. A value of the <literal>java.lang.String</literal> data type is now returned when the length of the <literal>char</literal> type is larger than 1.
      Show
      When executing a SQL query that returns values of the <literal>char</literal> SQL data type, a value of the <literal>java.lang.Character</literal> data type was returned, regardless of the <literal>char</literal> data type length. This caused that only the first character of the value was returned. A value of the <literal>java.lang.String</literal> data type is now returned when the length of the <literal>char</literal> type is larger than 1.
    • Documented as Resolved Issue
    • NEW

    Description

      When executing a sql query which returns columns of sql type char, a java.lang.Character is returned. This leads to returning just the first character of the value, a String should be returned when the char type has a width > 1.

      According to the community JIRA, the problem is in Dialect.java, where it registers all CHAR types to java.lang.Character.

      Attachments

        Activity

          People

            shaozliu Strong Liu(刘少壮) (Inactive)
            rhn-support-rmartine Ricardo Martinelli
            Petr Penicka Petr Penicka (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: