Problem writing java.lang.Long into database

From: Florian.Esk..i-de.com
Date: Mon Jan 15 2007 - 05:50:51 EST

  • Next message: ns..ykredit.dk: "Vedr.: Re: DB2 reengineering error Cp277"

    Hi,

    I have a problem with writing a java.lang.Long into our database.

    Example:
    I have a value in the database greater than java.lang.Integer.MAX_VALUE,
    example 9000000020.
    I can read the value correct from the database.

    I add 1 to the value (only for the example here), so we have the new value
    9000000021 in the Java data object.

    After a commit we have the value "410065439" in the database.

    This is exactl y the conversion:
          long lo = 9000000021L;
          int val = (int) lo;"

    The failure occurs during the write to the database.
    I think I have a small mapping problem and could not find the correct way
    to map java.lang.Long to our database.
    Sorry if a descriptin exist in the documentation, but I didn't found it

    Mapping File
          <obj-entity name="Value" className=
    "com.gide.pdvcms.bo.commonstore.Value" dbEntityName="VALUES"
                superClassName=
    "com.gide.pdvcms.bo.generic.GenericBusinessObject">
            ....
                <obj-attribute name="currentValue" type="java.lang.Long"
    db-attribute-path="CURRENT_VALUE"/>
            ....
          </obj-entity>

    Environment:
          Oracle 10 g
          cayenne 1.2
          jdk 1.4.2.10

    Later I need the same functionality in DB2.

    Thanks
    Florian



    This archive was generated by hypermail 2.0.0 : Mon Jan 15 2007 - 05:51:27 EST