Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2671

Wrong type mapping for double in HSQLDB

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Workaround
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: jdbc
    • Labels:
      None

      Description

      Currently, Java type double is mapped to NUMERIC for HSQLDB:

      HSQLDictionary.java, line 82
             doubleTypeName = "NUMERIC";
      

      (see https://fisheye6.atlassian.com/browse/~tag=2.4.1/openjpa/tags/2.4.1/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HSQLDictionary.java?hb=true).

      This seems wrong to me, as HSQLDB's NUMERIC is not a binary floating point type, but represents exact decimal numbers and maps to Java type BigDecimal (see HSQL documentation: http://hsqldb.org/doc/2.0/guide/sqlgeneral-chapt.html#sgc_numeric_types). The corresponding HSQL type for double is, according to this manual, REAL, FLOAT or DOUBLE (all being equivalent).

        Attachments

        1. testHsqldbDouble.zip
          3 kB
          Andreas Borg

          Activity

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              andreasborg Andreas Borg
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: