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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: EAP 5.0.0
    • Fix Version/s: EAP_EWP 5.2.0
    • Component/s: Hibernate
    • Labels:
      None
    • Environment:

      Hibernate 3.3.2.GA, Oracle 9.2, Oracle JDBC driver 10.2

    • Affects:
      Release Notes
    • Workaround:
      Workaround Exists
    • Workaround Description:
      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() );
    • Release Notes Text:
      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.
    • Release Notes Docs Status:
      Documented as Resolved Issue
    • Docs QE Status:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                stliu Strong Liu
                Reporter:
                rimolive Ricardo Martinelli Oliveira
                Writer:
                Petr Penicka
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: