[jira] Updated: (CAY-1125) MySQL SMALLINT UNSIGNED is mapped as java.lang.Short, should be java.lang.Integer

From: Ricardo Ghisi Tobaldini (JIRA) ("Ricardo)
Date: Thu Oct 16 2008 - 10:05:11 EDT

  • Next message: Ricardo Ghisi Tobaldini (JIRA): "[jira] Updated: (CAY-1125) MySQL SMALLINT UNSIGNED is mapped as java.lang.Short, should be java.lang.Integer"

         [ https://issues.apache.org/cayenne/browse/CAY-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Ricardo Ghisi Tobaldini updated CAY-1125:
    -----------------------------------------

        Attachment: testDump.sql

    Dump of the database used in the tests

    > MySQL SMALLINT UNSIGNED is mapped as java.lang.Short, should be java.lang.Integer
    > ---------------------------------------------------------------------------------
    >
    > Key: CAY-1125
    > URL: https://issues.apache.org/cayenne/browse/CAY-1125
    > Project: Cayenne
    > Issue Type: Bug
    > Components: Cayenne Core Library
    > Affects Versions: 2.0 [STABLE]
    > Environment: Ubuntu Linux 8.04, Java 1.6.0_07, MySQL 5.0.51a-3ubuntu5.1, MySQL Connector/J 5.1.6
    > Reporter: Ricardo Ghisi Tobaldini
    > Assignee: Andrus Adamchik
    > Attachments: source.zip, stacktrace.txt, testDump.sql
    >
    >
    > When trying to retrieve the value of a column that is of type "SMALLINT UNSIGNED" an exception of type com.mysql.jdbc.exceptions.jdbc4.MySQLDataException is raised.
    > This only happens if the value on that column is greater than 32767, since it overflows the Java Short type (that is always signed).
    > Forcing the type to INTEGER in the map.xml changes anything.
    > It seems that Cayenne is using a getShort() when it should use getInteger() (the later is always needed when using the unsigned version of SMALLINT in the database, doesn't it?).

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Thu Oct 16 2008 - 10:06:04 EDT