FAQ
MySQL 5 data type tinyint(1) not interpreted as java.lang.Boolean
-----------------------------------------------------------------

Key: CAY-1022
URL: https://issues.apache.org/cayenne/browse/CAY-1022
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 3.0
Environment: Cayenne 3.0M3, Modeler-win, Mysql 5
Reporter: Borut Bolčina
Assignee: Andrus Adamchik


If data type is defined as tinyint(1), the class for this attribute should be Boolean, but is insted Byte. Byte is ok if there is no length defined in parenthesis.
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-type-conversions.html

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

Search Discussions

  • Anonymous at May 8, 2008 at 4:57 pm
    [ https://issues.apache.org/cayenne/browse/CAY-1022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Andrus Adamchik closed CAY-1022.
    --------------------------------

    Resolution: Won't Fix

    I don't think we can do anything about that. The driver returns this as a BIT... ResultSetMeatadata.getColumns() returns the following (i tried drivers between 3.x to 5.1.x)

    rs.getInt("DATA_TYPE"); // returns -7 which is Types.BIT
    rs.getString("TYPE_NAME"); // returns "BIT"

    So I guess you may log a bug with MySQL
    MySQL 5 data type tinyint(1) not interpreted as java.lang.Boolean
    -----------------------------------------------------------------

    Key: CAY-1022
    URL: https://issues.apache.org/cayenne/browse/CAY-1022
    Project: Cayenne
    Issue Type: Bug
    Components: Cayenne Core Library
    Affects Versions: 3.0
    Environment: Cayenne 3.0M3, Modeler-win, Mysql 5
    Reporter: Borut Bolčina
    Assignee: Andrus Adamchik

    If data type is defined as tinyint(1), the class for this attribute should be Boolean, but is insted Byte. Byte is ok if there is no length defined in parenthesis.
    http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-type-conversions.html
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Anonymous at Jul 16, 2008 at 8:23 pm
    [ https://issues.apache.org/cayenne/browse/CAY-1022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010#action_13010 ]

    Borut Bolčina commented on CAY-1022:
    ------------------------------------

    I reverse engineered a database again today but with a different mysql driver - and woila - the problem was gone. The problem is (was) in the jconnector 3.1.6. Now with 5+ it works.
    MySQL 5 data type tinyint(1) not interpreted as java.lang.Boolean
    -----------------------------------------------------------------

    Key: CAY-1022
    URL: https://issues.apache.org/cayenne/browse/CAY-1022
    Project: Cayenne
    Issue Type: Bug
    Components: Cayenne Core Library
    Affects Versions: 3.0
    Environment: Cayenne 3.0M3, Modeler-win, Mysql 5
    Reporter: Borut Bolčina
    Assignee: Andrus Adamchik

    If data type is defined as tinyint(1), the class for this attribute should be Boolean, but is insted Byte. Byte is ok if there is no length defined in parenthesis.
    http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-type-conversions.html
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedApr 1, '08 at 11:04a
activeJul 16, '08 at 8:23p
posts3
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 3 posts

People

Translate

site design / logo © 2022 Grokbase