[OS-JIRA] Created: (CAY-399) Make objectsFromDataRows() more robust in type conversions

From: jira-norepl..bjectstyle.org
Date: Thu Nov 03 2005 - 21:13:38 EST

  • Next message: Andrus Adamchik: "cgen"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-399

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-399
        Summary: Make objectsFromDataRows() more robust in type conversions
           Type: Bug

         Status: Assigned
       Priority: Minor

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.2 [DEV]

       Assignee: Andrus Adamchik
       Reporter: Bryan Lewis

        Created: Thu, 3 Nov 2005 9:13 PM
        Updated: Thu, 3 Nov 2005 9:13 PM
    Environment: Probably not relevant, but discovered on linux, JDK 1.4 and Cayenne 1.2M4.

    Description:
    See my postings to the cayenne-user list on 10/28, 11/2 and 11/3/05. Occasionally a DataObject's Boolean property is being read by readProperty() as an Integer, causing a ClassCastException in the getter method. The property is stored in the Oracle database as an integer and is supposed to be converted to a Boolean by an extended type, which works correctly most of the time. Andrus suggested, "Type info can get blurry as Cayenne can't match raw data row query results with the right ExtendedTypes. In the future we should probably do extra type checking and conversions in objectsFromDataRows."

    The exception usually happened after a SQLTemplate query. One workaround would be to specify the java type of every attribute with #result macros but that would be quite messy and laborious for a large entity. For now I'm watching for the Integer object type in the couple of Boolean getter methods where it happens.

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Thu Nov 03 2005 - 21:13:38 EST