Re: Long X BigDecimal

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Nov 28 2003 - 20:48:52 EST

  • Next message: Andrus Adamchik: "Re: define relations both ways?"

    On Nov 28, 2003, at 3:10 PM, Andrus Adamchik wrote:

    > On Nov 28, 2003, at 1:19 PM, Leonardo R. Nunes wrote:
    >> I have a column X Numeric in my database and in my objEntity, I
    >> mapped an attribute of the type Long for this column.
    >>
    >> I’m doing a SQLQuery and using the method objectFromDataRow, but the
    >> type of the attribute of the object returned in the query is
    >> BigDecimal instead of Long.
    >>
    >> Is this a bug ?
    >
    > It likely is - when the data is fetched as a raw row, all Java values
    > are read using Cayenne default JDBC->Java mapping. So when later
    > converting a data row to an object, the wrong type maybe used -
    > something that does not happen when an object is created during the
    > query.
    >
    > I opened a bug report for further investigation:
    >
    > http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-45
    >
    > Thanks!
    > Andrus

    Please read Andriy's comment at
    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-45 for the
    solution with a SQL query. I am still planning to improve this
    functionality eventually, but likely sometime in 1.1 or after... So I
    reclassified the issue as an "improvement".

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Nov 28 2003 - 20:48:57 EST