Cayenne
  1. Cayenne
  2. CAY-45

Manually converting a DataRow to an object does not respect attribute types in ObjEntity

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.1 [LEGACY]
    • Fix Version/s: 1.1 [LEGACY]
    • Component/s: Core Library
    • Labels:
      None

      Description

      This was originally reported on cayenne-user:

      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 ?

      >>> Reply:
      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.

        Activity

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Andrus Adamchik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development